WebContent: Actually start WebDriver timeout timers

The timers added previously in #1021 had no effect, as they were never
started.
This commit is contained in:
Tim Ledbetter 2024-08-10 22:12:06 +01:00 committed by Tim Ledbetter
commit 5b09430c5e
Notes: github-actions[bot] 2024-08-10 22:18:57 +00:00

View file

@ -1936,6 +1936,7 @@ ErrorOr<void, Web::WebDriver::Error> WebDriverConnection::wait_for_navigation_to
auto timer = Core::Timer::create_single_shot(m_timeouts_configuration.page_load_timeout, [&] { auto timer = Core::Timer::create_single_shot(m_timeouts_configuration.page_load_timeout, [&] {
page_load_timeout_fired = true; 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. // 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([&] { 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, [&] { auto timer = Core::Timer::create_single_shot(m_timeouts_configuration.page_load_timeout, [&] {
page_load_timeout_fired = true; page_load_timeout_fired = true;
}); });
timer->start();
Web::Platform::EventLoopPlugin::the().spin_until([&]() { Web::Platform::EventLoopPlugin::the().spin_until([&]() {
auto state = m_page_client->page().top_level_traversable()->system_visibility_state(); 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, [&] { auto timer = Core::Timer::create_single_shot(m_timeouts_configuration.page_load_timeout, [&] {
page_load_timeout_fired = true; page_load_timeout_fired = true;
}); });
timer->start();
Web::Platform::EventLoopPlugin::the().spin_until([&]() { Web::Platform::EventLoopPlugin::the().spin_until([&]() {
auto state = m_page_client->page().top_level_traversable()->system_visibility_state(); auto state = m_page_client->page().top_level_traversable()->system_visibility_state();