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

WebContent: Store a base PageClient in the WebDriverConnection

WebDriverConnection can now work with PageClient's virtual interface.
This will allow constructing a WebDriverConnection from the PageClient
implementation in headless-browser.
This commit is contained in:
Timothy Flynn 2022-11-21 15:25:21 -05:00 committed by Linus Groh
parent d1c6b85dcf
commit be80d43161
2 changed files with 54 additions and 55 deletions

View file

@ -29,11 +29,11 @@ class WebDriverConnection final
C_OBJECT(WebDriverConnection)
public:
static ErrorOr<NonnullRefPtr<WebDriverConnection>> connect(ConnectionFromClient& web_content_client, PageHost& page_host, String const& webdriver_ipc_path);
static ErrorOr<NonnullRefPtr<WebDriverConnection>> connect(ConnectionFromClient& web_content_client, Web::PageClient& page_client, String const& webdriver_ipc_path);
virtual ~WebDriverConnection() = default;
private:
WebDriverConnection(NonnullOwnPtr<Core::Stream::LocalSocket> socket, ConnectionFromClient& web_content_client, PageHost& page_host);
WebDriverConnection(NonnullOwnPtr<Core::Stream::LocalSocket> socket, ConnectionFromClient& web_content_client, Web::PageClient& page_client);
virtual void die() override { }
@ -106,7 +106,7 @@ private:
void delete_cookies(Optional<StringView> const& name = {});
ConnectionFromClient& m_web_content_client;
PageHost& m_page_host;
Web::PageClient& m_page_client;
// https://w3c.github.io/webdriver/#dfn-page-load-strategy
Web::WebDriver::PageLoadStrategy m_page_load_strategy { Web::WebDriver::PageLoadStrategy::Normal };