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.
This commit is contained in:
Aliaksandr Kalenik 2023-03-06 01:45:30 +03:00 committed by Tim Flynn
commit 5c117cdcec
Notes: sideshowbarker 2024-07-16 23:17:57 +09:00
2 changed files with 3 additions and 1 deletions

View file

@ -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));

View file

@ -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;
};
}