1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 14:47:35 +00:00

Browser+WebContent+WebDriver: Move Get Page Source to WebContent

This commit is contained in:
Timothy Flynn 2022-11-10 18:00:01 -05:00 committed by Linus Groh
parent 561f9f36f7
commit 88dcdf681f
16 changed files with 26 additions and 61 deletions

View file

@ -607,10 +607,6 @@ void BrowserWindow::create_new_tab(URL url, bool activate)
return active_tab().view().take_screenshot();
};
new_tab.webdriver_endpoints().on_serialize_source = [this]() {
return active_tab().view().serialize_source();
};
new_tab.webdriver_endpoints().on_execute_script = [this](String const& body, Vector<String> const& json_arguments, Optional<u64> const& timeout, bool async) {
return active_tab().view().webdriver_execute_script(body, json_arguments, timeout, async);
};

View file

@ -58,18 +58,6 @@ void WebDriverConnection::forward()
browser_window->active_tab().go_forward();
}
Messages::WebDriverSessionClient::SerializeSourceResponse WebDriverConnection::serialize_source()
{
dbgln_if(WEBDRIVER_DEBUG, "WebDriverConnection: serialize_source");
if (auto browser_window = m_browser_window.strong_ref()) {
auto& tab = browser_window->active_tab();
if (tab.webdriver_endpoints().on_serialize_source)
return { tab.webdriver_endpoints().on_serialize_source() };
}
return { {} };
}
Messages::WebDriverSessionClient::ExecuteScriptResponse WebDriverConnection::execute_script(String const& body, Vector<String> const& json_arguments, Optional<u64> const& timeout, bool async)
{
dbgln("WebDriverConnection: execute_script");

View file

@ -42,7 +42,6 @@ public:
virtual void refresh() override;
virtual void back() override;
virtual void forward() override;
virtual Messages::WebDriverSessionClient::SerializeSourceResponse serialize_source() override;
virtual Messages::WebDriverSessionClient::ExecuteScriptResponse execute_script(String const& body, Vector<String> const& json_arguments, Optional<u64> const& timeout, bool async) override;
virtual Messages::WebDriverSessionClient::GetAllCookiesResponse get_all_cookies() override;
virtual Messages::WebDriverSessionClient::GetNamedCookieResponse get_named_cookie(String const& name) override;

View file

@ -23,7 +23,6 @@ public:
WebDriverEndpoints() = default;
~WebDriverEndpoints() = default;
Function<String()> on_serialize_source;
Function<Messages::WebContentServer::WebdriverExecuteScriptResponse(String const& body, Vector<String> const& json_arguments, Optional<u64> const& timeout, bool async)> on_execute_script;
};

View file

@ -18,7 +18,6 @@ endpoint WebDriverSessionClient {
refresh() =|
back() =|
forward() =|
serialize_source() => (String source)
execute_script(String body, Vector<String> json_arguments, Optional<u64> timeout, bool async) => (Web::WebDriver::ExecuteScriptResultType result_type, String json_result)
get_all_cookies() => (Vector<Web::Cookie::Cookie> cookies)
get_named_cookie(String name) => (Optional<Web::Cookie::Cookie> cookie)