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

Browser+WebContent+WebDriver: Move Take Screenshot to WebContent

This commit is contained in:
Timothy Flynn 2022-11-10 13:20:44 -05:00 committed by Linus Groh
parent 40b9d248be
commit de1e882601
9 changed files with 29 additions and 39 deletions

View file

@ -146,18 +146,6 @@ void WebDriverConnection::scroll_element_into_view(i32 element_id)
}
}
Messages::WebDriverSessionClient::TakeScreenshotResponse WebDriverConnection::take_screenshot()
{
dbgln_if(WEBDRIVER_DEBUG, "WebDriverConnection: take_screenshot");
if (auto browser_window = m_browser_window.strong_ref()) {
auto& tab = browser_window->active_tab();
if (tab.on_take_screenshot)
return { tab.on_take_screenshot() };
}
return { {} };
}
Messages::WebDriverSessionClient::TakeElementScreenshotResponse WebDriverConnection::take_element_screenshot(i32 element_id)
{
dbgln_if(WEBDRIVER_DEBUG, "WebDriverConnection: take_element_screenshot {}", element_id);

View file

@ -49,7 +49,6 @@ public:
virtual void add_cookie(Web::Cookie::ParsedCookie const&) override;
virtual void update_cookie(Web::Cookie::Cookie const&) override;
virtual void scroll_element_into_view(i32 element_id) override;
virtual Messages::WebDriverSessionClient::TakeScreenshotResponse take_screenshot() override;
virtual Messages::WebDriverSessionClient::TakeElementScreenshotResponse take_element_screenshot(i32 element_id) override;
private:

View file

@ -25,6 +25,5 @@ endpoint WebDriverSessionClient {
add_cookie(Web::Cookie::ParsedCookie cookie) =|
update_cookie(Web::Cookie::Cookie cookie) =|
scroll_element_into_view(i32 element_id) => ()
take_screenshot() => (Gfx::ShareableBitmap data)
take_element_screenshot(i32 element_id) => (Gfx::ShareableBitmap data)
}