1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 13:07:46 +00:00

WebDriver+Browser: Implement POST /session/{id}/window/maximize

This commit is contained in:
Timothy Flynn 2022-11-02 09:44:43 -04:00 committed by Linus Groh
parent 174248678e
commit 89b2ff72f7
7 changed files with 43 additions and 0 deletions

View file

@ -102,6 +102,13 @@ void WebDriverConnection::set_window_position(Gfx::IntPoint const& position)
browser_window->move_to(position);
}
void WebDriverConnection::maximize_window()
{
dbgln_if(WEBDRIVER_DEBUG, "WebDriverConnection: maximize_window");
if (auto browser_window = m_browser_window.strong_ref())
browser_window->set_maximized(true);
}
Messages::WebDriverSessionClient::GetAllCookiesResponse WebDriverConnection::get_all_cookies()
{
dbgln_if(WEBDRIVER_DEBUG, "WebDriverConnection: get_cookies");

View file

@ -47,6 +47,7 @@ public:
virtual void restore_window() override;
virtual void set_window_size(Gfx::IntSize const&) override;
virtual void set_window_position(Gfx::IntPoint const&) override;
virtual void maximize_window() override;
virtual Messages::WebDriverSessionClient::GetAllCookiesResponse get_all_cookies() override;
virtual Messages::WebDriverSessionClient::GetNamedCookieResponse get_named_cookie(String const& name) override;
virtual void add_cookie(Web::Cookie::ParsedCookie const&) override;

View file

@ -19,6 +19,7 @@ endpoint WebDriverSessionClient {
restore_window() =|
set_window_size(Gfx::IntSize size) =|
set_window_position(Gfx::IntPoint position) =|
maximize_window() =|
get_all_cookies() => (Vector<Web::Cookie::Cookie> cookies)
get_named_cookie(String name) => (Optional<Web::Cookie::Cookie> cookie)
add_cookie(Web::Cookie::ParsedCookie cookie) =|