Bug 1386496 - Ahem.ttf is broken on web-platform-tests. r?jgraham
Ahem.ttf is copied to $(DIST)/bin/firefox/fonts, but this file is broken due to text mode copy. So we should use binary mode instead.
MozReview-Commit-ID: KP7yNyPiejU
--- a/testing/mozharness/scripts/web_platform_tests.py
+++ b/testing/mozharness/scripts/web_platform_tests.py
@@ -237,17 +237,17 @@ class WebPlatformTest(TestingMixin, Merc
if not sys.platform.startswith("darwin"):
font_path = os.path.join(os.path.dirname(self.binary_path), "fonts")
else:
font_path = os.path.join(os.path.dirname(self.binary_path), os.pardir, "Resources", "res", "fonts")
if not os.path.exists(font_path):
os.makedirs(font_path)
ahem_src = os.path.join(dirs["abs_wpttest_dir"], "tests", "fonts", "Ahem.ttf")
ahem_dest = os.path.join(font_path, "Ahem.ttf")
- with open(ahem_src) as src, open(ahem_dest, "w") as dest:
+ with open(ahem_src, "rb") as src, open(ahem_dest, "wb") as dest:
dest.write(src.read())
def run_tests(self):
dirs = self.query_abs_dirs()
cmd = self._query_cmd()
self._install_fonts()
--- a/testing/web-platform/mach_commands.py
+++ b/testing/web-platform/mach_commands.py
@@ -120,17 +120,17 @@ class WebPlatformTestsRunnerSetup(Mozbui
# Ensure the Ahem font is available
if not sys.platform.startswith("darwin"):
font_path = os.path.join(os.path.dirname(self.get_binary_path()), "fonts")
else:
font_path = os.path.join(os.path.dirname(self.get_binary_path()), os.pardir, "Resources", "res", "fonts")
ahem_src = os.path.join(self.topsrcdir, "testing", "web-platform", "tests", "fonts", "Ahem.ttf")
ahem_dest = os.path.join(font_path, "Ahem.ttf")
if not os.path.exists(ahem_dest) and os.path.exists(ahem_src):
- with open(ahem_src) as src, open(ahem_dest, "w") as dest:
+ with open(ahem_src, "rb") as src, open(ahem_dest, "wb") as dest:
dest.write(src.read())
class WebPlatformTestsUpdater(MozbuildObject):
"""Update web platform tests."""
def run_update(self, **kwargs):
import update