From 5b09430c5efeb839242fb9db30f777cc446957d9 Mon Sep 17 00:00:00 2001 From: Tim Ledbetter Date: Sat, 10 Aug 2024 22:12:06 +0100 Subject: [PATCH] WebContent: Actually start WebDriver timeout timers The timers added previously in #1021 had no effect, as they were never started. --- Userland/Services/WebContent/WebDriverConnection.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Userland/Services/WebContent/WebDriverConnection.cpp b/Userland/Services/WebContent/WebDriverConnection.cpp index fe95d217939..fe8504ae09c 100644 --- a/Userland/Services/WebContent/WebDriverConnection.cpp +++ b/Userland/Services/WebContent/WebDriverConnection.cpp @@ -1936,6 +1936,7 @@ ErrorOr WebDriverConnection::wait_for_navigation_to auto timer = Core::Timer::create_single_shot(m_timeouts_configuration.page_load_timeout, [&] { page_load_timeout_fired = true; }); + timer->start(); // 4. If there is an ongoing attempt to navigate the current browsing context that has not yet matured, wait for navigation to mature. Web::Platform::EventLoopPlugin::the().spin_until([&] { @@ -1980,6 +1981,7 @@ void WebDriverConnection::restore_the_window() auto timer = Core::Timer::create_single_shot(m_timeouts_configuration.page_load_timeout, [&] { page_load_timeout_fired = true; }); + timer->start(); Web::Platform::EventLoopPlugin::the().spin_until([&]() { auto state = m_page_client->page().top_level_traversable()->system_visibility_state(); @@ -2009,6 +2011,7 @@ Gfx::IntRect WebDriverConnection::iconify_the_window() auto timer = Core::Timer::create_single_shot(m_timeouts_configuration.page_load_timeout, [&] { page_load_timeout_fired = true; }); + timer->start(); Web::Platform::EventLoopPlugin::the().spin_until([&]() { auto state = m_page_client->page().top_level_traversable()->system_visibility_state();