diff --git a/Userland/Utilities/headless-browser.cpp b/Userland/Utilities/headless-browser.cpp index a456b29ea5..e182e61452 100644 --- a/Userland/Utilities/headless-browser.cpp +++ b/Userland/Utilities/headless-browser.cpp @@ -54,6 +54,8 @@ constexpr int DEFAULT_TIMEOUT_MS = 30000; // 30sec +static StringView s_current_test_path; + class HeadlessWebContentView final : public WebView::ViewImplementation { public: static ErrorOr> create(Core::AnonymousBuffer theme, Gfx::IntSize const& window_size, StringView web_driver_ipc_path, Ladybird::IsLayoutTestMode is_layout_test_mode = Ladybird::IsLayoutTestMode::No) @@ -80,6 +82,14 @@ public: if (!web_driver_ipc_path.is_empty()) view->client().async_connect_to_webdriver(web_driver_ipc_path); + view->m_client_state.client->on_web_content_process_crash = [] { + warnln("\033[31;1mWebContent Crashed!!\033[0m"); + if (!s_current_test_path.is_empty()) { + warnln(" Last started test: {}", s_current_test_path); + } + VERIFY_NOT_REACHED(); + }; + return view; } @@ -328,6 +338,7 @@ static ErrorOr run_ref_test(HeadlessWebContentView& view, StringView static ErrorOr run_test(HeadlessWebContentView& view, StringView input_path, StringView expectation_path, TestMode mode, bool dump_failed_ref_tests) { + s_current_test_path = input_path; switch (mode) { case TestMode::Text: case TestMode::Layout: