diff --git a/testing/mozharness/scripts/web_platform_tests.py b/testing/mozharness/scripts/web_platform_tests.py index 5fc325314c2e..8ce489063070 100755 --- a/testing/mozharness/scripts/web_platform_tests.py +++ b/testing/mozharness/scripts/web_platform_tests.py @@ -233,6 +233,12 @@ class WebPlatformTest(TestingMixin, MercurialScript, CodeCoverageMixin, AndroidM if not sys.platform.startswith("linux"): cmd += ["--exclude=css"] + if mozinfo.info["os"] == "win" and mozinfo.info["os_version"] == "6.1": + # On Windows 7 --install-fonts fails, so fall back to a Firefox-specific codepath + self._install_fonts() + else: + cmd += ["--install-fonts"] + for test_type in test_types: cmd.append("--test-type=%s" % test_type) @@ -329,8 +335,6 @@ class WebPlatformTest(TestingMixin, MercurialScript, CodeCoverageMixin, AndroidM def run_tests(self): dirs = self.query_abs_dirs() - self._install_fonts() - parser = StructuredOutputParser(config=self.config, log_obj=self.log_obj, log_compact=True, diff --git a/testing/web-platform/mach_commands.py b/testing/web-platform/mach_commands.py index 9e7601e3c53c..6d3e2a8fec61 100644 --- a/testing/web-platform/mach_commands.py +++ b/testing/web-platform/mach_commands.py @@ -78,6 +78,7 @@ class WebPlatformTestsRunnerSetup(MozbuildObject): return kwargs def kwargs_firefox(self, kwargs): + import mozinfo from wptrunner import wptcommandline kwargs = self.kwargs_common(kwargs) @@ -90,7 +91,12 @@ class WebPlatformTestsRunnerSetup(MozbuildObject): if kwargs["webdriver_binary"] is None: kwargs["webdriver_binary"] = self.get_binary_path("geckodriver", validate_exists=False) - self.setup_fonts_firefox() + + if mozinfo.info["os"] == "win" and mozinfo.info["os_version"] == "6.1": + # On Windows 7 --install-fonts fails, so fall back to a Firefox-specific codepath + self.setup_fonts_firefox() + else: + kwargs["install_fonts"] = True kwargs = wptcommandline.check_args(kwargs) @@ -141,6 +147,7 @@ class WebPlatformTestsRunnerSetup(MozbuildObject): dest.write(src.read()) + class WebPlatformTestsUpdater(MozbuildObject): """Update web platform tests.""" def setup_logging(self, **kwargs): diff --git a/testing/web-platform/tests/tools/wptrunner/wptrunner/wptrunner.py b/testing/web-platform/tests/tools/wptrunner/wptrunner/wptrunner.py index 7ac7b709436c..0a5b1352e212 100644 --- a/testing/web-platform/tests/tools/wptrunner/wptrunner/wptrunner.py +++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/wptrunner.py @@ -150,7 +150,7 @@ def run_tests(config, test_paths, product, **kwargs): if kwargs["install_fonts"]: env_extras.append(FontInstaller( font_dir=kwargs["font_dir"], - ahem=os.path.join(kwargs["tests_root"], "fonts/Ahem.ttf") + ahem=os.path.join(test_paths["/"]["tests_path"], "fonts/Ahem.ttf") )) run_info, test_loader = get_loader(test_paths,