Bug 1513142 [wpt PR 14445] - Make desktop webdriver WPT harness work, a=testonly
authorJosh Matthews <josh@joshmatthews.net>
Wed, 19 Dec 2018 11:04:49 +0000
changeset 514986 eb308a03c89719a689ada807dbeb401663871be1
parent 514985 9b149504cdfacae7f3c773121cf8b75b2890a71c
child 514987 d8d39489c8e7849f1f5fa01159f31b824b1914fe
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1513142, 14445
milestone66.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 1513142 [wpt PR 14445] - Make desktop webdriver WPT harness work, a=testonly Automatic update from web-platform-tests Add headless support to servodriver harness. -- Make SSL tests work in servodriver. -- wpt-commits: 60ba182bd77ab4f4ed3f734aae3304c077497c69, bbdfa0a4b6d2187e3b2e41a40bb583f9dd2f04f1 wpt-pr: 14445
testing/web-platform/tests/tools/wptrunner/wptrunner/browsers/servodriver.py
--- a/testing/web-platform/tests/tools/wptrunner/wptrunner/browsers/servodriver.py
+++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/browsers/servodriver.py
@@ -37,16 +37,17 @@ def check_args(**kwargs):
 
 def browser_kwargs(test_type, run_info_data, config, **kwargs):
     return {
         "binary": kwargs["binary"],
         "binary_args": kwargs["binary_args"],
         "debug_info": kwargs["debug_info"],
         "server_config": config,
         "user_stylesheets": kwargs.get("user_stylesheets"),
+        "headless": kwargs.get("headless"),
     }
 
 
 def executor_kwargs(test_type, server_config, cache_manager, run_info_data, **kwargs):
     rv = base_executor_kwargs(test_type, server_config,
                               cache_manager, run_info_data, **kwargs)
     return rv
 
@@ -72,28 +73,30 @@ def write_hosts_file(config):
     return hosts_path
 
 
 class ServoWebDriverBrowser(Browser):
     used_ports = set()
     init_timeout = 300  # Large timeout for cases where we're booting an Android emulator
 
     def __init__(self, logger, binary, debug_info=None, webdriver_host="127.0.0.1",
-                 server_config=None, binary_args=None, user_stylesheets=None):
+                 server_config=None, binary_args=None, user_stylesheets=None, headless=None):
         Browser.__init__(self, logger)
         self.binary = binary
         self.binary_args = binary_args or []
         self.webdriver_host = webdriver_host
         self.webdriver_port = None
         self.proc = None
         self.debug_info = debug_info
         self.hosts_path = write_hosts_file(server_config)
         self.server_ports = server_config.ports if server_config else {}
         self.command = None
         self.user_stylesheets = user_stylesheets if user_stylesheets else []
+        self.headless = headless if headless else False
+        self.ca_certificate_path = server_config.ssl_config["ca_cert_path"]
 
     def start(self, **kwargs):
         self.webdriver_port = get_free_port(4444, exclude=self.used_ports)
         self.used_ports.add(self.webdriver_port)
 
         env = os.environ.copy()
         env["HOST_FILE"] = self.hosts_path
         env["RUST_BACKTRACE"] = "1"
@@ -109,16 +112,22 @@ class ServoWebDriverBrowser(Browser):
             self.binary_args + [
                 "--hard-fail",
                 "--webdriver=%s" % self.webdriver_port,
                 "about:blank",
             ],
             self.debug_info
         )
 
+        if self.headless:
+            command += ["--headless"]
+
+        if self.ca_certificate_path:
+            command += ["--certificate-path", self.ca_certificate_path]
+
         for stylesheet in self.user_stylesheets:
             command += ["--user-stylesheet", stylesheet]
 
         self.command = command
 
         self.command = debug_args + self.command
 
         if not self.debug_info or not self.debug_info.interactive: