https://bugs.webkit.org/show_bug.cgi?id=188465
Reviewed by Žan Doberšek.
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.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234753
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+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 Žan Doberšek.
+
+ 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.
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()));
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()) {
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()) {