mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 02:17:34 +00:00
WebContent: Remove WebContent::ConnectionFromClient from WebDriver
This commit is contained in:
parent
46b2cb308d
commit
0135a2ab5b
2 changed files with 5 additions and 8 deletions
|
@ -32,7 +32,6 @@
|
||||||
#include <LibWeb/Platform/Timer.h>
|
#include <LibWeb/Platform/Timer.h>
|
||||||
#include <LibWeb/WebDriver/ExecuteScript.h>
|
#include <LibWeb/WebDriver/ExecuteScript.h>
|
||||||
#include <LibWeb/WebDriver/Screenshot.h>
|
#include <LibWeb/WebDriver/Screenshot.h>
|
||||||
#include <WebContent/ConnectionFromClient.h>
|
|
||||||
#include <WebContent/WebDriverConnection.h>
|
#include <WebContent/WebDriverConnection.h>
|
||||||
|
|
||||||
namespace WebContent {
|
namespace WebContent {
|
||||||
|
@ -252,18 +251,17 @@ static ErrorOr<PropertyType, Web::WebDriver::Error> get_property(JsonValue const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ErrorOr<NonnullRefPtr<WebDriverConnection>> WebDriverConnection::connect(ConnectionFromClient& web_content_client, Web::PageClient& page_client, String const& webdriver_ipc_path)
|
ErrorOr<NonnullRefPtr<WebDriverConnection>> WebDriverConnection::connect(Web::PageClient& page_client, String const& webdriver_ipc_path)
|
||||||
{
|
{
|
||||||
dbgln_if(WEBDRIVER_DEBUG, "Trying to connect to {}", webdriver_ipc_path);
|
dbgln_if(WEBDRIVER_DEBUG, "Trying to connect to {}", webdriver_ipc_path);
|
||||||
auto socket = TRY(Core::Stream::LocalSocket::connect(webdriver_ipc_path));
|
auto socket = TRY(Core::Stream::LocalSocket::connect(webdriver_ipc_path));
|
||||||
|
|
||||||
dbgln_if(WEBDRIVER_DEBUG, "Connected to WebDriver");
|
dbgln_if(WEBDRIVER_DEBUG, "Connected to WebDriver");
|
||||||
return try_create(move(socket), web_content_client, page_client);
|
return try_create(move(socket), page_client);
|
||||||
}
|
}
|
||||||
|
|
||||||
WebDriverConnection::WebDriverConnection(NonnullOwnPtr<Core::Stream::LocalSocket> socket, ConnectionFromClient& web_content_client, Web::PageClient& page_client)
|
WebDriverConnection::WebDriverConnection(NonnullOwnPtr<Core::Stream::LocalSocket> socket, Web::PageClient& page_client)
|
||||||
: IPC::ConnectionToServer<WebDriverClientEndpoint, WebDriverServerEndpoint>(*this, move(socket))
|
: IPC::ConnectionToServer<WebDriverClientEndpoint, WebDriverServerEndpoint>(*this, move(socket))
|
||||||
, m_web_content_client(web_content_client)
|
|
||||||
, m_page_client(page_client)
|
, m_page_client(page_client)
|
||||||
, m_current_window_handle("main"sv)
|
, m_current_window_handle("main"sv)
|
||||||
{
|
{
|
||||||
|
|
|
@ -29,11 +29,11 @@ class WebDriverConnection final
|
||||||
C_OBJECT(WebDriverConnection)
|
C_OBJECT(WebDriverConnection)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static ErrorOr<NonnullRefPtr<WebDriverConnection>> connect(ConnectionFromClient& web_content_client, Web::PageClient& page_client, String const& webdriver_ipc_path);
|
static ErrorOr<NonnullRefPtr<WebDriverConnection>> connect(Web::PageClient& page_client, String const& webdriver_ipc_path);
|
||||||
virtual ~WebDriverConnection() = default;
|
virtual ~WebDriverConnection() = default;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
WebDriverConnection(NonnullOwnPtr<Core::Stream::LocalSocket> socket, ConnectionFromClient& web_content_client, Web::PageClient& page_client);
|
WebDriverConnection(NonnullOwnPtr<Core::Stream::LocalSocket> socket, Web::PageClient& page_client);
|
||||||
|
|
||||||
virtual void die() override { }
|
virtual void die() override { }
|
||||||
|
|
||||||
|
@ -105,7 +105,6 @@ private:
|
||||||
ErrorOr<ScriptArguments, Web::WebDriver::Error> extract_the_script_arguments_from_a_request(JsonValue const& payload);
|
ErrorOr<ScriptArguments, Web::WebDriver::Error> extract_the_script_arguments_from_a_request(JsonValue const& payload);
|
||||||
void delete_cookies(Optional<StringView> const& name = {});
|
void delete_cookies(Optional<StringView> const& name = {});
|
||||||
|
|
||||||
ConnectionFromClient& m_web_content_client;
|
|
||||||
Web::PageClient& m_page_client;
|
Web::PageClient& m_page_client;
|
||||||
|
|
||||||
// https://w3c.github.io/webdriver/#dfn-page-load-strategy
|
// https://w3c.github.io/webdriver/#dfn-page-load-strategy
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue