File tree Expand file tree Collapse file tree 4 files changed +15
-2
lines changed Expand file tree Collapse file tree 4 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ endpoint WebDriverClient {
17
17
get_title() => (Web::WebDriver::Response response)
18
18
get_window_handle() => (String handle)
19
19
close_window() => (Web::WebDriver::Response response)
20
+ switch_to_window() => (Web::WebDriver::Response response)
20
21
new_window(JsonValue payload) => (Web::WebDriver::Response response)
21
22
get_window_rect() => (Web::WebDriver::Response response)
22
23
set_window_rect(JsonValue payload) => (Web::WebDriver::Response response)
Original file line number Diff line number Diff line change @@ -545,6 +545,16 @@ Messages::WebDriverClient::CloseWindowResponse WebDriverConnection::close_window
545
545
return JsonValue {};
546
546
}
547
547
548
+ // 11.3 Switch to Window, https://w3c.github.io/webdriver/#dfn-switch-to-window
549
+ Messages::WebDriverClient::SwitchToWindowResponse WebDriverConnection::switch_to_window ()
550
+ {
551
+ // 5. Update any implementation-specific state that would result from the user selecting the current
552
+ // browsing context for interaction, without altering OS-level focus.
553
+ m_page_client.page_did_request_activate_tab ();
554
+
555
+ return JsonValue {};
556
+ }
557
+
548
558
// 11.5 New Window, https://w3c.github.io/webdriver/#dfn-new-window
549
559
Messages::WebDriverClient::NewWindowResponse WebDriverConnection::new_window (JsonValue const &)
550
560
{
Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ class WebDriverConnection final
54
54
virtual Messages::WebDriverClient::GetTitleResponse get_title () override ;
55
55
virtual Messages::WebDriverClient::GetWindowHandleResponse get_window_handle () override ;
56
56
virtual Messages::WebDriverClient::CloseWindowResponse close_window () override ;
57
+ virtual Messages::WebDriverClient::SwitchToWindowResponse switch_to_window () override ;
57
58
virtual Messages::WebDriverClient::NewWindowResponse new_window (JsonValue const & payload) override ;
58
59
virtual Messages::WebDriverClient::GetWindowRectResponse get_window_rect () override ;
59
60
virtual Messages::WebDriverClient::SetWindowRectResponse set_window_rect (JsonValue const & payload) override ;
Original file line number Diff line number Diff line change @@ -144,8 +144,9 @@ Web::WebDriver::Response Session::switch_to_window(StringView handle)
144
144
else
145
145
return Web::WebDriver::Error::from_code (Web::WebDriver::ErrorCode::NoSuchWindow, " Window not found" );
146
146
147
- // FIXME: 5. Update any implementation-specific state that would result from the user selecting the current
148
- // browsing context for interaction, without altering OS-level focus.
147
+ // 5. Update any implementation-specific state that would result from the user selecting the current
148
+ // browsing context for interaction, without altering OS-level focus.
149
+ TRY (web_content_connection ().switch_to_window ());
149
150
150
151
// 6. Return success with data null.
151
152
return JsonValue {};
You can’t perform that action at this time.
0 commit comments