mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 02:37:36 +00:00
WebContent+WebDriver: Move window commands handling back to WebDriver
With current architecture every window has its own WebContent process
and there is one WebDriver process that is responsible for talking to
all opened windows. It thus make sense to manage open windows from
WebDriver process instead of WebContent process that is not supposed
to know about all other opened WebContent processes.
This mostly reverts 826d5f8f9a
but also
adds `web_content_connection` to window structure and window id
generation (currently out of spec).
With these changes `get_window_handles`, `switch_to_window` and
`close_window` start to actually switch, close and returned handles
of currently opened windows.
This commit is contained in:
parent
d036862f2b
commit
0905fd57e4
6 changed files with 99 additions and 91 deletions
|
@ -52,10 +52,7 @@ private:
|
|||
virtual Messages::WebDriverClient::ForwardResponse forward() override;
|
||||
virtual Messages::WebDriverClient::RefreshResponse refresh() override;
|
||||
virtual Messages::WebDriverClient::GetTitleResponse get_title() override;
|
||||
virtual Messages::WebDriverClient::GetWindowHandleResponse get_window_handle() override;
|
||||
virtual Messages::WebDriverClient::CloseWindowResponse close_window() override;
|
||||
virtual Messages::WebDriverClient::SwitchToWindowResponse switch_to_window(JsonValue const& payload) override;
|
||||
virtual Messages::WebDriverClient::GetWindowHandlesResponse get_window_handles() override;
|
||||
virtual Messages::WebDriverClient::GetWindowRectResponse get_window_rect() override;
|
||||
virtual Messages::WebDriverClient::SetWindowRectResponse set_window_rect(JsonValue const& payload) override;
|
||||
virtual Messages::WebDriverClient::MaximizeWindowResponse maximize_window() override;
|
||||
|
@ -125,13 +122,6 @@ private:
|
|||
|
||||
// https://w3c.github.io/webdriver/#dfn-session-script-timeout
|
||||
Web::WebDriver::TimeoutsConfiguration m_timeouts_configuration;
|
||||
|
||||
struct Window {
|
||||
DeprecatedString handle;
|
||||
bool is_open { false };
|
||||
};
|
||||
HashMap<DeprecatedString, Window> m_windows;
|
||||
DeprecatedString m_current_window_handle;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue