Tests: Use wider test string in FontFace arraybuffer matching test

This test relies on the width of the test font and the fallback font
being different to determine whether they matched or not. The
`offsetWidth` rounding change introduced in 51c7afdf5f caused these
widths to appear the same, meaning the test failed. This change avoids
the issue by using a longer string with a deliberately wide glyph.
This commit is contained in:
Tim Ledbetter
2026-04-05 08:01:17 +01:00
committed by Andreas Kling
parent 7f4600f0e9
commit 2c728abd9f
Notes: github-actions[bot] 2026-04-05 07:20:31 +00:00

View File

@@ -13,13 +13,16 @@
const element = document.createElement("span");
element.style.fontFamily = "TestFont, serif";
element.style.fontSize = "20px";
element.textContent = "test";
// We use a deliberately long string and a wide glyph here to ensure the width of the test font and the fallback
// font will be different.
const testString = "WWWWWWWWWWWWWWWWWWWW"
element.textContent = testString;
document.body.appendChild(element);
const fallbackElement = document.createElement("span");
fallbackElement.style.fontFamily = "serif";
fallbackElement.style.fontSize = "20px";
fallbackElement.textContent = "test";
fallbackElement.textContent = testString;
document.body.appendChild(fallbackElement);
// Force layout