Bug 1494049 [wpt PR 13201] - Add headless mode for chrome_webdriver, a=testonly
authorGeoffrey Sneddon <me@gsnedders.com>
Fri, 28 Sep 2018 09:54:17 +0000
changeset 494491 a46c08092f37ff84190acaa8c08f30b3ab09a709
parent 494490 eecc27b7ef231fa3f30fdee9fde57129e8b85638
child 494492 64129f7c59689e0201fc9fb94c233c0d73edf17f
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1494049, 13201
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1494049 [wpt PR 13201] - Add headless mode for chrome_webdriver, a=testonly Automatic update from web-platform-testsAdd headless mode for chrome_webdriver (#13201) 0200c63a74a540dfb870881d5f476280c367d1c1 failed to add this to chrome_webdriver, so add this now. -- wpt-commits: 1e7408fcd394b66234c38c24ba044ec6f00e4b70 wpt-pr: 13201
testing/web-platform/tests/tools/wptrunner/wptrunner/browsers/chrome_webdriver.py
--- a/testing/web-platform/tests/tools/wptrunner/wptrunner/browsers/chrome_webdriver.py
+++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/browsers/chrome_webdriver.py
@@ -36,15 +36,21 @@ def executor_kwargs(test_type, server_co
             "w3c": True
         }
     }
 
     for (kwarg, capability) in [("binary", "binary"), ("binary_args", "args")]:
         if kwargs[kwarg] is not None:
             capabilities["goog:chromeOptions"][capability] = kwargs[kwarg]
 
+    if kwargs["headless"]:
+        if "args" not in capabilities["goog:chromeOptions"]:
+            capabilities["goog:chromeOptions"]["args"] = []
+        if "--headless" not in capabilities["goog:chromeOptions"]["args"]:
+            capabilities["goog:chromeOptions"]["args"].append("--headless")
+
     if test_type == "testharness":
         capabilities["goog:chromeOptions"]["useAutomationExtension"] = False
         capabilities["goog:chromeOptions"]["excludeSwitches"] = ["enable-automation"]
 
     executor_kwargs["capabilities"] = capabilities
 
     return executor_kwargs