LibWeb+WebContent+WebDriver: Bring session start and close up to spec

Lots of editorial spec bugs here, but these changes largely affect how
the unhandledPromptBehavior capability is handled. We also now set an
additional capability for the default User Agent string.
This commit is contained in:
Timothy Flynn 2025-02-05 16:05:25 -05:00 committed by Tim Flynn
parent 2583996e18
commit ee649fc13b
Notes: github-actions[bot] 2025-02-06 14:02:15 +00:00
9 changed files with 290 additions and 131 deletions

View file

@ -223,9 +223,11 @@ void WebDriverConnection::close_session()
// 1. Set the webdriver-active flag to false.
set_is_webdriver_active(false);
// 2. An endpoint node must close any top-level browsing contexts associated with the session, without prompting to unload.
if (auto browsing_context = current_top_level_browsing_context())
browsing_context->top_level_traversable()->close_top_level_traversable();
// 5. Optionally, close all top-level browsing contexts, without prompting to unload.
for (auto navigable : Web::HTML::all_navigables()) {
if (auto traversable = navigable->top_level_traversable())
traversable->close_top_level_traversable();
}
}
void WebDriverConnection::set_page_load_strategy(Web::WebDriver::PageLoadStrategy const& page_load_strategy)