Skip to content

Commit

Permalink
Bug 1623813 [wpt PR 22347] - css-grid: Use documents.font.ready() for…
Browse files Browse the repository at this point in the history
… tests with Ahem font., a=testonly

Automatic update from web-platform-tests
css-grid: Wait for documents.font.ready() for tests with Ahem font (#22347)

web-fonts may not be ready when the window.onload signal is triggered,
so to avoid flakiness or unexpected failures on the css-grid tests that
use the Ahem font we should wait for the fonts to be ready before
starting the test.

However, that is not enough, we should also waiting for window.load
before starting the tests because some tests depend on the document
images to load (which may happen before or after the fonts are ready)

So this patch changes the tests using Ahem to start after the load
event has fired and after the fonts are ready.

The tests now need to use "explicit_done: true" to avoid race conditions,
so this commit also sets this tests to be explicit about when they finish.

--

wpt-commits: ea0533fc00ee855b02231c8e392c3ddadb943b0f
wpt-pr: 22347

UltraBlame original commit: 6ecf4cf5f694976506259cf0870c665099a692cd
  • Loading branch information
marco-c committed Apr 1, 2020
1 parent a7ed5cb commit de5a20b
Show file tree
Hide file tree
Showing 236 changed files with 844 additions and 247 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,11 @@
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
<script type="text/javascript">
setup({ explicit_done: true });
</script>

<body onload="checkLayout('.grid')">
<body onload="document.fonts.ready.then(() => { checkLayout('.grid'); })">

<div id="log"></div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,10 @@
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
<body onload="checkLayout('.grid')">
<script type="text/javascript">
setup({ explicit_done: true });
</script>
<body onload="document.fonts.ready.then(() => { checkLayout('.grid'); })">

<div id="log"></div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
<body onload="checkLayout('.container')">
<script type="text/javascript">
setup({ explicit_done: true });
</script>
<body onload="document.fonts.ready.then(() => { checkLayout('.container'); })">

<div id="log"></div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,11 @@
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
<script type="text/javascript">
setup({ explicit_done: true });
</script>

<body onload="checkLayout('.grid')">
<body onload="document.fonts.ready.then(() => { checkLayout('.grid'); })">

<div id="log"></div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,11 @@
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
<script type="text/javascript">
setup({ explicit_done: true });
</script>

<body onload="checkLayout('.grid')">
<body onload="document.fonts.ready.then(() => { checkLayout('.grid'); })">

<div id="log"></div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,11 @@
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
<script type="text/javascript">
setup({ explicit_done: true });
</script>

<body onload="checkLayout('.grid')">
<body onload="document.fonts.ready.then(() => { checkLayout('.grid'); })">

<div id="log"></div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,11 @@
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
<script type="text/javascript">
setup({ explicit_done: true });
</script>

<body onload="checkLayout('.grid')">
<body onload="document.fonts.ready.then(() => { checkLayout('.grid'); })">

<div id="log"></div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,11 @@
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
<script type="text/javascript">
setup({ explicit_done: true });
</script>

<body onload="checkLayout('.grid')">
<body onload="document.fonts.ready.then(() => { checkLayout('.grid'); })">

<div id="log"></div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,11 @@
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
<script type="text/javascript">
setup({ explicit_done: true });
</script>

<body onload="checkLayout('.grid')">
<body onload="document.fonts.ready.then(() => { checkLayout('.grid'); })">

<div id="log"></div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,11 @@
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
<script type="text/javascript">
setup({ explicit_done: true });
</script>

<body onload="checkLayout('.grid')">
<body onload="document.fonts.ready.then(() => { checkLayout('.grid'); })">

<p>This test checks that the align-content property is applied correctly when using content-distribution values in vertical-lr writing mode.</p>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,11 @@
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
<script type="text/javascript">
setup({ explicit_done: true });
</script>

<body onload="checkLayout('.grid')">
<body onload="document.fonts.ready.then(() => { checkLayout('.grid'); })">

<p>This test checks that the align-content property is applied correctly when using content-distribution values for vertical-rl mode.</p>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,11 @@
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
<script type="text/javascript">
setup({ explicit_done: true });
</script>

<body onload="checkLayout('.grid')">
<body onload="document.fonts.ready.then(() => { checkLayout('.grid'); })">

<p>This test checks that the align-content property is applied correctly when using content-distribution values.</p>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,11 @@
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
<script type="text/javascript">
setup({ explicit_done: true });
</script>

<body onload="checkLayout('.grid')">
<body onload="document.fonts.ready.then(() => { checkLayout('.grid'); })">

<div style="position: relative">
<p>direction: LTR | align-content: 'center'</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,11 @@
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
<script type="text/javascript">
setup({ explicit_done: true });
</script>

<body onload="checkLayout('.grid')">
<body onload="document.fonts.ready.then(() => { checkLayout('.grid'); })">

<div style="position: relative">
<p>direction: LTR | align-content: 'center'</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,11 @@
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
<script type="text/javascript">
setup({ explicit_done: true });
</script>

<body onload="checkLayout('.grid')">
<body onload="document.fonts.ready.then(() => { checkLayout('.grid'); })">

<div style="position: relative">
<p>direction: LTR | align-content: 'center'</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
<script type="text/javascript">
setup({ explicit_done: true });
</script>

<body onload="checkLayout('.grid')">
<body onload="document.fonts.ready.then(() => { checkLayout('.grid'); })">

<p>This test checks that the 'margin', 'border' and 'padding' properties are applied together correctly for 'align' and 'justify' properties on vertical-LR grids.</p>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
<script type="text/javascript">
setup({ explicit_done: true });
</script>

<body onload="checkLayout('.grid')">
<body onload="document.fonts.ready.then(() => { checkLayout('.grid'); })">

<p>This test checks that the 'margin', 'border' and 'padding' properties are applied together correctly for 'align' and 'justify' properties on vertical-RL grids.</p>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,11 @@
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
<script type="text/javascript">
setup({ explicit_done: true });
</script>

<body onload="checkLayout('.grid')">
<body onload="document.fonts.ready.then(() => { checkLayout('.grid'); })">

<p>This test checks that the 'margin', 'border' and 'padding' properties are applied together correctly for 'align' and 'justify' properties.</p>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,11 @@
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
<script type="text/javascript">
setup({ explicit_done: true });
</script>

<body onload="checkLayout('.grid')">
<body onload="document.fonts.ready.then(() => { checkLayout('.grid'); })">

<p>This test checks that the 'overflow' keyword is applied correctly for 'align' and 'justify' properties.</p>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,11 @@
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
<script type="text/javascript">
setup({ explicit_done: true });
</script>

<body onload="checkLayout('.grid')">
<body onload="document.fonts.ready.then(() => { checkLayout('.grid'); })">

<p>This test checks that stretching alignment works as expected with orthogonal flows.</p>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,11 @@
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
<script type="text/javascript">
setup({ explicit_done: true });
</script>

<body onload="checkLayout('.grid')">
<body onload="document.fonts.ready.then(() => { checkLayout('.grid'); })">

<div style="position: relative">
<div class="grid fit-content" data-expected-width="200" data-expected-height="400">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
<script type="text/javascript">
setup({ explicit_done: true });
</script>

<body onload="checkLayout('.grid')">
<body onload="document.fonts.ready.then(() => { checkLayout('.grid'); })">

<p>This test checks that the alignment properties align-self and justify-self apply the 'stretch' value correctly on replaced elements.</p>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,11 @@
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
<script type="text/javascript">
setup({ explicit_done: true });
</script>

<body onload="checkLayout('.grid')">
<body onload="document.fonts.ready.then(() => { checkLayout('.grid'); })">

<div style="position: relative">
<div class="grid fit-content" data-expected-width="200" data-expected-height="400">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,15 @@
<script src="/resources/check-layout-th.js"></script>
<script src="support/style-change.js"></script>
<script>
setup({ explicit_done: true });
function runTest() {
evaluateStyleChange(item, "before", "data-expected-height", 200);
grid.style.alignItems = "start";
evaluateStyleChange(item, "after", "data-expected-height", 100);
done();
}
</script>
<body onload="runTest()">
<body onload="document.fonts.ready.then(() => { runTest(); })">
<div class="grid" id="grid">
<div data-expected-width="100" id="item">XX X<br>X XXX<br>X<br>XX XXX</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,15 @@
<script src="/resources/check-layout-th.js"></script>
<script src="support/style-change.js"></script>
<script>
setup({ explicit_done: true });
function runTest() {
evaluateStyleChange(item, "before", "data-expected-height", 100);
grid.style.alignItems = "stretch";
evaluateStyleChange(item, "after", "data-expected-height", 200);
done();
}
</script>
<body onload="runTest()">
<body onload="document.fonts.ready.then(() => { runTest(); })">
<div class="grid" id="grid">
<div data-expected-width="100" id="item">XX X<br>X XXX<br>X<br>XX XXX</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,15 @@
<script src="/resources/check-layout-th.js"></script>
<script src="support/style-change.js"></script>
<script>
setup({ explicit_done: true });
function runTest() {
evaluateStyleChange(item, "before", "data-expected-height", 200);
grid.style.alignItems = "normal";
evaluateStyleChange(item, "after", "data-expected-height", 200);
done();
}
</script>
<body onload="runTest()">
<body onload="document.fonts.ready.then(() => { runTest(); })">
<div class="grid" id="grid">
<div data-expected-width="100" id="item">XX X<br>X XXX<br>X<br>XX XXX</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,15 @@
<script src="/resources/check-layout-th.js"></script>
<script src="support/style-change.js"></script>
<script>
setup({ explicit_done: true });
function runTest() {
evaluateStyleChange(item, "before", "data-expected-height", 200);
grid.style.alignItems = "stretch";
evaluateStyleChange(item, "after", "data-expected-height", 200);
done();
}
</script>
<body onload="runTest()">
<body onload="document.fonts.ready.then(() => { runTest(); })">
<div class="grid" id="grid">
<div data-expected-width="100" id="item">XX X<br>X XXX<br>X<br>XX XXX</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,15 @@
<script src="/resources/check-layout-th.js"></script>
<script src="support/style-change.js"></script>
<script>
setup({ explicit_done: true });
function runTest() {
evaluateStyleChange(item, "before", "data-expected-height", 100);
grid.style.alignItems = "normal";
evaluateStyleChange(item, "after", "data-expected-height", 200);
done();
}
</script>
<body onload="runTest()">
<body onload="document.fonts.ready.then(() => { runTest(); })">
<div class="grid" id="grid">
<div data-expected-width="100" id="item">XX X<br>X XXX<br>X<br>XX XXX</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,15 @@
<script src="/resources/check-layout-th.js"></script>
<script src="support/style-change.js"></script>
<script>
setup({ explicit_done: true });
function runTest() {
evaluateStyleChange(item, "before", "data-expected-height", 200);
grid.style.alignItems = "start";
evaluateStyleChange(item, "after", "data-expected-height", 100);
done();
}
</script>
<body onload="runTest()">
<body onload="document.fonts.ready.then(() => { runTest(); })">
<div class="grid" id="grid">
<div data-expected-width="100" id="item">XX X<br>X XXX<br>X<br>XX XXX</div>
</div>
Expand Down
Loading

0 comments on commit de5a20b

Please sign in to comment.