소스 검색

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.
Sam Atkins 7 달 전
부모
커밋
bc971a4ccc
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      UI/Headless/HeadlessWebView.cpp

+ 4 - 0
UI/Headless/HeadlessWebView.cpp

@@ -184,6 +184,10 @@ void HeadlessWebView::did_receive_screenshot(Badge<WebView::WebContentClient>, G
 
 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));
 }