diff options
Diffstat (limited to '')
-rw-r--r-- | layout/tools/reftest/runreftest.py | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/layout/tools/reftest/runreftest.py b/layout/tools/reftest/runreftest.py index e97a6de5d7..cac1f7dd3c 100644 --- a/layout/tools/reftest/runreftest.py +++ b/layout/tools/reftest/runreftest.py @@ -302,6 +302,7 @@ class RefTest(object): self.outputHandler = None self.testDumpFile = os.path.join(tempfile.gettempdir(), "reftests.json") self.currentManifest = "No test started" + self.gtkTheme = self.getGtkTheme() self.run_by_manifest = True if suite in ("crashtest", "jstestbrowser"): @@ -328,6 +329,17 @@ class RefTest(object): "reftest harness", options, {"tbpl": sys.stdout}, fmt_options ) + def getGtkTheme(self): + if not platform.system() == "Linux": + return "" + + theme_cmd = "gsettings get org.gnome.desktop.interface gtk-theme" + theme = subprocess.check_output(theme_cmd, shell=True, universal_newlines=True) + if theme: + theme = theme.strip("\n") + theme = theme.strip("'") + return theme.strip() + def getFullPath(self, path): "Get an absolute path relative to self.oldcwd." return os.path.normpath(os.path.join(self.oldcwd, os.path.expanduser(path))) @@ -357,14 +369,14 @@ class RefTest(object): locations.add_host(server, scheme="http", port=port) locations.add_host(server, scheme="https", port=port) - sandbox_whitelist_paths = options.sandboxReadWhitelist + sandbox_allowlist_paths = options.sandboxReadWhitelist if platform.system() == "Linux" or platform.system() in ( "Windows", "Microsoft", ): # Trailing slashes are needed to indicate directories on Linux and Windows - sandbox_whitelist_paths = map( - lambda p: os.path.join(p, ""), sandbox_whitelist_paths + sandbox_allowlist_paths = map( + lambda p: os.path.join(p, ""), sandbox_allowlist_paths ) addons = [] @@ -390,7 +402,7 @@ class RefTest(object): kwargs = { "addons": addons, "locations": locations, - "whitelistpaths": sandbox_whitelist_paths, + "allowlistpaths": sandbox_allowlist_paths, } if profile_to_clone: profile = mozprofile.Profile.clone(profile_to_clone, **kwargs) @@ -539,6 +551,9 @@ class RefTest(object): browserEnv["TZ"] = "PST8PDT" browserEnv["LC_ALL"] = "en_US.UTF-8" + # This should help with consistency + browserEnv["GTK_THEME"] = "Adwaita" + for v in options.environment: ix = v.find("=") if ix <= 0: @@ -1100,6 +1115,13 @@ class RefTest(object): overall = 0 status = -1 for manifest, tests in tests_by_manifest.items(): + if self.getGtkTheme() != self.gtkTheme: + self.log.error( + "Theme (%s) has changed to (%s), terminating job as this is unstable" + % (self.gtkTheme, self.getGtkTheme()) + ) + return 1 + self.log.info("Running tests in {}".format(manifest)) self.currentManifest = manifest status = run(tests=tests) |