summaryrefslogtreecommitdiff
path: root/Userland/Services/WebDriver
diff options
context:
space:
mode:
authorAliaksandr Kalenik <kalenik.aliaksandr@gmail.com>2023-03-06 01:45:30 +0300
committerTim Flynn <trflynn89@pm.me>2023-03-07 07:16:23 -0500
commit5c117cdcec640b2149a98916a4bc1118e6f59c83 (patch)
tree14f0a479faf674dfb7398a4febc1fede9c0d0952 /Userland/Services/WebDriver
parent0905fd57e44ab4ad89e8a6be2c5671b754f204c1 (diff)
downloadserenity-5c117cdcec640b2149a98916a4bc1118e6f59c83.zip
WebDriver: Keep WebDriver socket listening until session end
WebDriver socket should not be closed as soon as first client got connected becaused there might more than one WebContent process spawned by browser.
Diffstat (limited to 'Userland/Services/WebDriver')
-rw-r--r--Userland/Services/WebDriver/Session.cpp2
-rw-r--r--Userland/Services/WebDriver/Session.h2
2 files changed, 3 insertions, 1 deletions
diff --git a/Userland/Services/WebDriver/Session.cpp b/Userland/Services/WebDriver/Session.cpp
index 3de3394790..408e858f8b 100644
--- a/Userland/Services/WebDriver/Session.cpp
+++ b/Userland/Services/WebDriver/Session.cpp
@@ -70,7 +70,7 @@ ErrorOr<void> Session::start(LaunchBrowserCallbacks const& callbacks)
auto promise = TRY(ServerPromise::try_create());
m_web_content_socket_path = DeprecatedString::formatted("{}/webdriver/session_{}_{}", TRY(Core::StandardPaths::runtime_directory()), getpid(), m_id);
- auto web_content_server = TRY(create_server(promise));
+ m_web_content_server = TRY(create_server(promise));
if (m_options.headless)
m_browser_pid = TRY(callbacks.launch_headless_browser(*m_web_content_socket_path));
diff --git a/Userland/Services/WebDriver/Session.h b/Userland/Services/WebDriver/Session.h
index 2af79c8f50..49467af9ad 100644
--- a/Userland/Services/WebDriver/Session.h
+++ b/Userland/Services/WebDriver/Session.h
@@ -67,6 +67,8 @@ private:
Optional<DeprecatedString> m_web_content_socket_path;
Optional<pid_t> m_browser_pid;
+
+ RefPtr<Core::LocalServer> m_web_content_server;
};
}