浏览代码

headless-browser: Do not immediately exit when running under WebDriver

We need to spin the Application's event loop.
Timothy Flynn 18 小时之前
父节点
当前提交
34b8784dd9
共有 1 个文件被更改,包括 4 次插入5 次删除
  1. 4 5
      Ladybird/Headless/main.cpp

+ 4 - 5
Ladybird/Headless/main.cpp

@@ -98,10 +98,9 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
         return completion.result == Ladybird::TestResult::Pass ? 0 : 1;
         return completion.result == Ladybird::TestResult::Pass ? 0 : 1;
     }
     }
 
 
-    if (!WebView::Application::chrome_options().webdriver_content_ipc_path.has_value()) {
-        auto timer = TRY(load_page_for_screenshot_and_exit(Core::EventLoop::current(), view, url, app->screenshot_timeout));
-        return app->execute();
-    }
+    RefPtr<Core::Timer> timer;
+    if (!WebView::Application::chrome_options().webdriver_content_ipc_path.has_value())
+        timer = TRY(load_page_for_screenshot_and_exit(Core::EventLoop::current(), view, url, app->screenshot_timeout));
 
 
-    return 0;
+    return app->execute();
 }
 }