Bug 1493907 - [wptrunner] Expose headless flag for expected meta data. r=webdriver-reviewers,ato
authorHenrik Skupin <mail@hskupin.info>
Wed, 03 Jul 2019 19:23:10 +0000
changeset 540815 0609705a34727f7049ce2e97f214823031b5f703
parent 540814 80afa74b9d9f95d663dc7f93e8077ab50f9d73ef
child 540816 d62f57d8e0b72ba75be5b50bb02d042ec2ace36c
push id11529
push userarchaeopteryx@coole-files.de
push dateThu, 04 Jul 2019 15:22:33 +0000
treeherdermozilla-beta@ebb510a784b8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswebdriver-reviewers, ato
bugs1493907
milestone69.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 1493907 - [wptrunner] Expose headless flag for expected meta data. r=webdriver-reviewers,ato Differential Revision: https://phabricator.services.mozilla.com/D36723
testing/web-platform/tests/tools/wptrunner/wptrunner/browsers/firefox.py
testing/web-platform/tests/tools/wptrunner/wptrunner/wpttest.py
--- a/testing/web-platform/tests/tools/wptrunner/wptrunner/browsers/firefox.py
+++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/browsers/firefox.py
@@ -155,17 +155,17 @@ def run_info_extras(**kwargs):
         for key, value in kwargs.get('extra_prefs', []):
             if pref == key:
                 return value.lower() in ('true', '1')
         return False
 
     rv = {"e10s": kwargs["gecko_e10s"],
           "wasm": kwargs.get("wasm", True),
           "verify": kwargs["verify"],
-          "headless": "MOZ_HEADLESS" in os.environ,
+          "headless": kwargs.get("headless", False) or "MOZ_HEADLESS" in os.environ,
           "fission": get_bool_pref("fission.autostart"),
           "sw-e10s": get_bool_pref("dom.serviceWorkers.parent_intercept")}
     rv.update(run_info_browser_version(kwargs["binary"]))
     return rv
 
 
 def run_info_browser_version(binary):
     try:
--- a/testing/web-platform/tests/tools/wptrunner/wptrunner/wpttest.py
+++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/wpttest.py
@@ -98,18 +98,21 @@ class RunInfo(dict):
         if browser_channel:
             self["browser_channel"] = browser_channel
 
         self["verify"] = verify
         if "wasm" not in self:
             self["wasm"] = False
         if extras is not None:
             self.update(extras)
+
+        self["headless"] = extras["headless"]
         self["webrender"] = enable_webrender
 
+
     def _update_mozinfo(self, metadata_root):
         """Add extra build information from a mozinfo.json file in a parent
         directory"""
         import mozinfo
 
         path = metadata_root
         dirs = set()
         while path != os.path.expanduser('~'):