WebDriver: Send window handle asynchronously after WebContent connects

This prevents a potential deadlock when tests open many popup windows
in quick succession.
This commit is contained in:
Tim Ledbetter
2026-02-11 13:46:07 +00:00
committed by Tim Flynn
parent 6e1f2c10d6
commit cb803899c2
Notes: github-actions[bot] 2026-02-15 13:22:53 +00:00
6 changed files with 56 additions and 22 deletions

View File

@@ -203,7 +203,9 @@ ErrorOr<NonnullRefPtr<WebDriverConnection>> WebDriverConnection::connect(Web::Pa
page_client.page().set_should_block_pop_ups(false);
dbgln_if(WEBDRIVER_DEBUG, "Connected to WebDriver");
return adopt_nonnull_ref_or_enomem(new (nothrow) WebDriverConnection(make<IPC::Transport>(move(socket)), page_client));
auto connection = TRY(adopt_nonnull_ref_or_enomem(new (nothrow) WebDriverConnection(make<IPC::Transport>(move(socket)), page_client)));
connection->async_did_set_window_handle(page_client.page().top_level_traversable()->window_handle());
return connection;
}
WebDriverConnection::WebDriverConnection(NonnullOwnPtr<IPC::Transport> transport, Web::PageClient& page_client)