summaryrefslogtreecommitdiff
path: root/Userland/Services
diff options
context:
space:
mode:
authorMacDue <macdue@dueutil.tech>2023-03-13 20:31:29 +0000
committerLinus Groh <mail@linusgroh.de>2023-03-24 22:06:38 +0000
commitceffca9a75899eb8bcfdc089e7999e2db96e3bce (patch)
tree4c17a10340bdb11e41eb15b976242a1da7743772 /Userland/Services
parent2aa8c9950e92534a3fb1347629b7b019c388ddc4 (diff)
downloadserenity-ceffca9a75899eb8bcfdc089e7999e2db96e3bce.zip
WebDriver: Use Core::Process::spawn() to launch browsers
Diffstat (limited to 'Userland/Services')
-rw-r--r--Userland/Services/WebDriver/main.cpp29
1 files changed, 12 insertions, 17 deletions
diff --git a/Userland/Services/WebDriver/main.cpp b/Userland/Services/WebDriver/main.cpp
index 9581c336de..231efce657 100644
--- a/Userland/Services/WebDriver/main.cpp
+++ b/Userland/Services/WebDriver/main.cpp
@@ -7,6 +7,7 @@
#include <LibCore/ArgsParser.h>
#include <LibCore/Directory.h>
#include <LibCore/EventLoop.h>
+#include <LibCore/Process.h>
#include <LibCore/StandardPaths.h>
#include <LibCore/System.h>
#include <LibCore/TCPServer.h>
@@ -15,27 +16,21 @@
static ErrorOr<pid_t> launch_browser(DeprecatedString const& socket_path)
{
- char const* argv[] = {
- "/bin/Browser",
- "--webdriver-content-path",
- socket_path.characters(),
- nullptr,
- };
-
- return Core::System::posix_spawn("/bin/Browser"sv, nullptr, nullptr, const_cast<char**>(argv), environ);
+ return Core::Process::spawn("/bin/Browser"sv,
+ Array {
+ "--webdriver-content-path",
+ socket_path.characters(),
+ });
}
static ErrorOr<pid_t> launch_headless_browser(DeprecatedString const& socket_path)
{
- char const* argv[] = {
- "/bin/headless-browser",
- "--webdriver-ipc-path",
- socket_path.characters(),
- "about:blank",
- nullptr,
- };
-
- return Core::System::posix_spawn("/bin/headless-browser"sv, nullptr, nullptr, const_cast<char**>(argv), environ);
+ return Core::Process::spawn("/bin/headless-browser"sv,
+ Array {
+ "--webdriver-ipc-path",
+ socket_path.characters(),
+ "about:blank",
+ });
}
ErrorOr<int> serenity_main(Main::Arguments arguments)