Tests: Fix flaky test timeout

If the iframe had loaded before the test was executed this would timeout
This commit is contained in:
Callum Law
2026-03-12 21:47:38 +13:00
committed by Alexander Kalenik
parent f5e4018b7e
commit 9b4cd4fe62
Notes: github-actions[bot] 2026-03-12 11:01:41 +00:00

View File

@@ -19,21 +19,22 @@
<script src="../include.js"></script>
<script>
asyncTest(done => {
iframe.addEventListener("load", () => {
asyncTest(async done => {
if (iframe.contentDocument?.readyState !== "complete")
await new Promise(resolve => iframe.addEventListener("load", resolve));
requestAnimationFrame(() => {
requestAnimationFrame(() => {
requestAnimationFrame(() => {
const target = iframe.contentDocument.querySelector("#target");
const target = iframe.contentDocument.querySelector("#target");
println(getComputedStyle(target).order);
for (let height of [1, 2, 3]) {
iframe.style.height = `${height}px`;
println(getComputedStyle(target).order);
}
for (let height of [1, 2, 3]) {
iframe.style.height = `${height}px`;
println(getComputedStyle(target).order);
}
done();
});
done();
});
});
});