1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 01:27:34 +00:00

WebDriver: Implement POST /session/{id}/window/fullscreen endpoint

This commit is contained in:
Tobias Christiansen 2022-11-09 19:09:17 +01:00 committed by Linus Groh
parent 6805cf00ad
commit 1aa16b4dd4
12 changed files with 57 additions and 0 deletions

View file

@ -473,6 +473,13 @@ Gfx::IntRect OutOfProcessWebView::notify_server_did_request_minimize_window()
return {};
}
Gfx::IntRect OutOfProcessWebView::notify_server_did_request_fullscreen_window()
{
if (on_fullscreen_window)
return on_fullscreen_window();
return {};
}
void OutOfProcessWebView::notify_server_did_request_file(Badge<WebContentClient>, String const& path, i32 request_id)
{
auto file = FileSystemAccessClient::Client::the().try_request_file_read_only_approved(window(), path);

View file

@ -106,6 +106,7 @@ public:
Function<Gfx::IntSize(Gfx::IntSize const&)> on_resize_window;
Function<Gfx::IntRect()> on_maximize_window;
Function<Gfx::IntRect()> on_minimize_window;
Function<Gfx::IntRect()> on_fullscreen_window;
private:
OutOfProcessWebView();
@ -174,6 +175,7 @@ private:
virtual Gfx::IntSize notify_server_did_request_resize_window(Gfx::IntSize const&) override;
virtual Gfx::IntRect notify_server_did_request_maximize_window() override;
virtual Gfx::IntRect notify_server_did_request_minimize_window() override;
virtual Gfx::IntRect notify_server_did_request_fullscreen_window() override;
virtual void notify_server_did_request_file(Badge<WebContentClient>, String const& path, i32) override;
void request_repaint();

View file

@ -61,6 +61,7 @@ public:
virtual Gfx::IntSize notify_server_did_request_resize_window(Gfx::IntSize const&) = 0;
virtual Gfx::IntRect notify_server_did_request_maximize_window() = 0;
virtual Gfx::IntRect notify_server_did_request_minimize_window() = 0;
virtual Gfx::IntRect notify_server_did_request_fullscreen_window() = 0;
virtual void notify_server_did_request_file(Badge<WebContentClient>, String const& path, i32) = 0;
};

View file

@ -255,6 +255,11 @@ Messages::WebContentClient::DidRequestMinimizeWindowResponse WebContentClient::d
return m_view.notify_server_did_request_minimize_window();
}
Messages::WebContentClient::DidRequestFullscreenWindowResponse WebContentClient::did_request_fullscreen_window()
{
return m_view.notify_server_did_request_fullscreen_window();
}
void WebContentClient::did_request_file(String const& path, i32 request_id)
{
m_view.notify_server_did_request_file({}, path, request_id);

View file

@ -72,6 +72,7 @@ private:
virtual Messages::WebContentClient::DidRequestResizeWindowResponse did_request_resize_window(Gfx::IntSize const&) override;
virtual Messages::WebContentClient::DidRequestMaximizeWindowResponse did_request_maximize_window() override;
virtual Messages::WebContentClient::DidRequestMinimizeWindowResponse did_request_minimize_window() override;
virtual Messages::WebContentClient::DidRequestFullscreenWindowResponse did_request_fullscreen_window() override;
virtual void did_request_file(String const& path, i32) override;
ViewImplementation& m_view;