tests: Use Ahem font provided by WPT harness. (#37054)

#37021 exposed that our tests are trying to load a local file path for
Ahem.ttf, but this stops working when we implement the specified CORS
protections for our font requests. Luckily, the WPT suite already
provides a same-origin version of the same font, so we can just update
our CSS to use that font face instead.

Testing: Existing WPT coverage.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
Josh Matthews 2025-06-09 04:13:05 -04:00 committed by GitHub
parent 4e9993128b
commit 27527adf35
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 14 additions and 78 deletions

View file

@ -28,4 +28,3 @@
[.test 16: space-around]
expected: FAIL

View file

@ -8608,7 +8608,7 @@
],
"css": {
"ahem.css": [
"51eede74aaa0b43f2c9235019bc73a508b1f14e4",
"a7db592e0df53e0b70f66ca7b31a7734db18887e",
[]
]
},
@ -10654,7 +10654,7 @@
[]
],
"no_mime_type.py": [
"860005a42c237735287031133786352d7c732402",
"980eeee18f993f20a9df033f337a52ec93155ec4",
[]
],
"origin_helpers.js": [

View file

@ -1,3 +1,9 @@
@font-face {
font-family: 'ahem';
src: local('Ahem'),
url('/fonts/Ahem.ttf');
}
body {
font-family: 'ahem';
font-size: 100px;

View file

@ -7,5 +7,5 @@ def main(request, response):
headers = []
if b'Content-Type' in request.GET:
headers += [(b'Content-Type', request.GET[b'Content-Type'])]
with open('./resources/ahem/AHEM____.TTF', 'rb') as f:
with open('./tests/wpt/tests/fonts/Ahem.ttf', 'rb') as f:
return 200, headers, f.read()