1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:28:12 +00:00

WebContent+WebDriver: Set the navigator.webdriver flag from WebDriver

This moves setting the navigator.webdriver flag from after WebContent
creates the WebDriver connection, to its own IPC to be triggered from
WebDriver. This is closer to the spec, but mostly serves as an easy
test to validate the connection.
This commit is contained in:
Timothy Flynn 2022-11-08 10:42:12 -05:00 committed by Tim Flynn
parent 50ae1ad18a
commit f7c212a19d
8 changed files with 17 additions and 10 deletions

View file

@ -385,6 +385,8 @@ Web::WebDriver::Response Client::handle_new_session(Vector<StringView> const&, J
return Web::WebDriver::Error::from_code(Web::WebDriver::ErrorCode::SessionNotCreated, String::formatted("Failed to start session: {}", start_result.error().string_literal()));
}
auto& web_content_connection = session->web_content_connection();
// FIXME: 8. Set the current session to session.
// FIXME: 9. Run any WebDriver new session algorithm defined in external specifications,
@ -405,7 +407,8 @@ Web::WebDriver::Response Client::handle_new_session(Vector<StringView> const&, J
// FIXME: 12. Initialize the following from capabilities:
// NOTE: See spec for steps
// FIXME: 13. Set the webdriver-active flag to true.
// 13. Set the webdriver-active flag to true.
web_content_connection.async_set_is_webdriver_active(true);
// FIXME: 14. Set the current top-level browsing context for session with the top-level browsing context
// of the UAs current browsing context.