From 5c117cdcec640b2149a98916a4bc1118e6f59c83 Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Mon, 6 Mar 2023 01:45:30 +0300 Subject: [PATCH] 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. --- Userland/Services/WebDriver/Session.cpp | 2 +- Userland/Services/WebDriver/Session.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) 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 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 m_web_content_socket_path; Optional m_browser_pid; + + RefPtr m_web_content_server; }; }