Skip to content

Commit

Permalink
Make a test reliable by waiting for font loads.
Browse files Browse the repository at this point in the history
Differential Revision: https://phabricator.services.mozilla.com/D205543

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1887522
gecko-commit: f5a00c2272483b66f764456af1f4dd06e548837c
gecko-reviewers: layout-reviewers, jfkthame
  • Loading branch information
emilio authored and moz-wptsync-bot committed Mar 26, 2024
1 parent 2da89e3 commit 7ebe316
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion css/css-scoping/font-face-006.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</style>
<div id="host"></div>
<script>
test(function() {
promise_test(async function() {
host.attachShadow({ mode: "open" }).innerHTML = `
<style>
:host::before, :host::after {
Expand All @@ -27,6 +27,8 @@
<slot></slot>
`;

await document.fonts.ready;

//shrinkwrapped size for a default font will be a bit more than 80-90
//if the font is applied, it will be a bit more than 160
assert_greater_than(document.getElementById('host').offsetWidth, 160);
Expand Down

0 comments on commit 7ebe316

Please sign in to comment.