WebKit Bugzilla
Attachment 346899 Details for
Bug 188465
: [GTK][WPE] WebDriver: do not use default browser arguments when browser binary has been provided
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
wd-browser-arguments-default.diff (text/plain), 4.01 KB, created by
Carlos Garcia Campos
on 2018-08-10 00:50:14 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Carlos Garcia Campos
Created:
2018-08-10 00:50:14 PDT
Size:
4.01 KB
patch
obsolete
>diff --git a/Source/WebDriver/ChangeLog b/Source/WebDriver/ChangeLog >index 473252dccea..cdb30fbfc14 100644 >--- a/Source/WebDriver/ChangeLog >+++ b/Source/WebDriver/ChangeLog >@@ -1,3 +1,21 @@ >+2018-08-10 Carlos Garcia Campos <cgarcia@igalia.com> >+ >+ [GTK][WPE] WebDriver: do not use default browser arguments when browser binary has been provided >+ https://bugs.webkit.org/show_bug.cgi?id=188465 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ We only want to use --automation when no options or no browser binary is provided, because we fallback to >+ MiniBrowser and we know it needs --automation flag. >+ >+ * glib/SessionHostGlib.cpp: >+ (WebDriver::SessionHost::launchBrowser): Handle the case of browser arguments being std::nullopt. >+ * gtk/WebDriverServiceGtk.cpp: >+ (WebDriver::WebDriverService::platformParseCapabilities const): Initialize browser arguments to std:nullopt if >+ browser binary was provided. >+ * wpe/WebDriverServiceWPE.cpp: >+ (WebDriver::WebDriverService::platformParseCapabilities const): Ditto. >+ > 2018-08-03 Ms2ger <Ms2ger@igalia.com> > > Fix invalid optional access in WebDriver Session::createTopLevelBrowsingContext. >diff --git a/Source/WebDriver/glib/SessionHostGlib.cpp b/Source/WebDriver/glib/SessionHostGlib.cpp >index 941381f7a7c..a5aa783593b 100644 >--- a/Source/WebDriver/glib/SessionHostGlib.cpp >+++ b/Source/WebDriver/glib/SessionHostGlib.cpp >@@ -147,11 +147,11 @@ void SessionHost::launchBrowser(Function<void (std::optional<String> error)>&& c > g_subprocess_launcher_setenv(launcher.get(), "GTK_OVERLAY_SCROLLING", m_capabilities.useOverlayScrollbars.value() ? "1" : "0", TRUE); > #endif > >- const auto& browserArguments = m_capabilities.browserArguments.value(); >- GUniquePtr<char*> args(g_new0(char*, browserArguments.size() + 2)); >+ size_t browserArgumentsSize = m_capabilities.browserArguments ? m_capabilities.browserArguments->size() : 0; >+ GUniquePtr<char*> args(g_new0(char*, browserArgumentsSize + 2)); > args.get()[0] = g_strdup(m_capabilities.browserBinary.value().utf8().data()); >- for (unsigned i = 0; i < browserArguments.size(); ++i) >- args.get()[i + 1] = g_strdup(browserArguments[i].utf8().data()); >+ for (unsigned i = 0; i < browserArgumentsSize; ++i) >+ args.get()[i + 1] = g_strdup(m_capabilities.browserArguments.value()[i].utf8().data()); > > GUniqueOutPtr<GError> error; > m_browser = adoptGRef(g_subprocess_launcher_spawnv(launcher.get(), args.get(), &error.outPtr())); >diff --git a/Source/WebDriver/gtk/WebDriverServiceGtk.cpp b/Source/WebDriver/gtk/WebDriverServiceGtk.cpp >index 81f8a474353..808b7e2298a 100644 >--- a/Source/WebDriver/gtk/WebDriverServiceGtk.cpp >+++ b/Source/WebDriver/gtk/WebDriverServiceGtk.cpp >@@ -121,8 +121,10 @@ void WebDriverService::platformParseCapabilities(const JSON::Object& matchedCapa > return; > > String browserBinary; >- if (browserOptions->getString("binary"_s, browserBinary)) >+ if (browserOptions->getString("binary"_s, browserBinary)) { > capabilities.browserBinary = browserBinary; >+ capabilities.browserArguments = std::nullopt; >+ } > > RefPtr<JSON::Array> browserArguments; > if (browserOptions->getArray("args"_s, browserArguments) && browserArguments->length()) { >diff --git a/Source/WebDriver/wpe/WebDriverServiceWPE.cpp b/Source/WebDriver/wpe/WebDriverServiceWPE.cpp >index d8e677d5e40..c62de132338 100644 >--- a/Source/WebDriver/wpe/WebDriverServiceWPE.cpp >+++ b/Source/WebDriver/wpe/WebDriverServiceWPE.cpp >@@ -88,8 +88,10 @@ void WebDriverService::platformParseCapabilities(const JSON::Object& matchedCapa > return; > > String browserBinary; >- if (browserOptions->getString("binary"_s, browserBinary)) >+ if (browserOptions->getString("binary"_s, browserBinary)) { > capabilities.browserBinary = browserBinary; >+ capabilities.browserArguments = std::nullopt; >+ } > > RefPtr<JSON::Array> browserArguments; > if (browserOptions->getArray("args"_s, browserArguments) && browserArguments->length()) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
zan
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 188465
: 346899