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

Browser+WebDriver: Remove the connection between Browser and WebDriver

WebDriver now only has an IPC connection to WebContent. WebDriver still
launches the browser, but now when the session ends, we simply send a
SIGTERM signal to the browser.
This commit is contained in:
Timothy Flynn 2022-11-11 14:14:58 -05:00 committed by Linus Groh
parent c64da0d00c
commit 7972916be7
11 changed files with 20 additions and 219 deletions

View file

@ -14,7 +14,6 @@
#include <LibCore/Promise.h>
#include <LibWeb/WebDriver/Error.h>
#include <LibWeb/WebDriver/Response.h>
#include <WebDriver/BrowserConnection.h>
#include <WebDriver/TimeoutsConfiguration.h>
#include <WebDriver/WebContentConnection.h>
#include <unistd.h>
@ -57,20 +56,16 @@ public:
Web::WebDriver::Response take_element_screenshot(StringView element_id);
private:
enum class ServerType {
Browser,
WebContent,
};
using ServerPromise = Core::Promise<ErrorOr<void>>;
ErrorOr<NonnullRefPtr<Core::LocalServer>> create_server(String const& socket_path, ServerType type, NonnullRefPtr<ServerPromise> promise);
ErrorOr<NonnullRefPtr<Core::LocalServer>> create_server(String const& socket_path, NonnullRefPtr<ServerPromise> promise);
NonnullRefPtr<Client> m_client;
bool m_started { false };
unsigned m_id { 0 };
HashMap<String, NonnullOwnPtr<Window>> m_windows;
String m_current_window_handle;
RefPtr<BrowserConnection> m_browser_connection;
RefPtr<WebContentConnection> m_web_content_connection;
Optional<pid_t> m_browser_pid;
// https://w3c.github.io/webdriver/#dfn-session-script-timeout
TimeoutsConfiguration m_timeouts_configuration;