mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-24 01:42:17 +00:00
UI/Headless: Clear pending data when a test completes
Without this, a crashing ref test is able to take down the entire process because of the `VERIFY(!m_pending_screenshot);` in `take_screenshot()`. The dialog/prompt fields were not causing crashes but clearing them feels more hygienic.
This commit is contained in:
parent
ce65457746
commit
bc971a4ccc
Notes:
github-actions[bot]
2024-12-18 17:39:54 +00:00
Author: https://github.com/AtkinsSJ
Commit: bc971a4ccc
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2950
Reviewed-by: https://github.com/tcl3 ✅
1 changed files with 4 additions and 0 deletions
|
@ -184,6 +184,10 @@ void HeadlessWebView::did_receive_screenshot(Badge<WebView::WebContentClient>, G
|
||||||
|
|
||||||
void HeadlessWebView::on_test_complete(TestCompletion completion)
|
void HeadlessWebView::on_test_complete(TestCompletion completion)
|
||||||
{
|
{
|
||||||
|
m_pending_screenshot.clear();
|
||||||
|
m_pending_dialog = Web::Page::PendingDialog::None;
|
||||||
|
m_pending_prompt_text.clear();
|
||||||
|
|
||||||
m_test_promise->resolve(move(completion));
|
m_test_promise->resolve(move(completion));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue