Skip to content

Commit

Permalink
Fix some view transitions crashtests (#45924)
Browse files Browse the repository at this point in the history
They are currently written as reftests with reftest-wait and friends, convert them to use test-wait.
  • Loading branch information
nt1m authored Apr 26, 2024
1 parent e29076d commit 6ae7875
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,27 +1,25 @@
<!DOCTYPE html>
<html class=reftest-wait>
<html class=test-wait>
<title>View transitions: crash test</title>
<link rel="help" href="https://www.w3.org/TR/css-view-transitions-1/">
<link rel="author" href="mailto:[email protected]">
<script src="/common/reftest-wait.js"></script>
<html>
<head>
<script>
function eventhandler1() {
var var00106 = htmlvar00011.contentDocument;
var var00228 = var00106.startViewTransition();
var iframeDoc = iframe.contentDocument;
var viewTransition = iframeDoc.startViewTransition();
requestAnimationFrame(() => {
requestAnimationFrame(() => {
requestAnimationFrame(takeScreenshot);
requestAnimationFrame(() => document.documentElement.classList.remove("test-wait"));
})
});
}

</script>
</head>
<body>
<iframe id="htmlvar00011" onunload="eventhandler3()" border="0" srcdoc="A#:^;&lt;gV&lt;&gt;8" style=":{,J" referrerpolicy="unsafe-url" background="!xp&gt;" nohref="nohref" nonce="nonce" inputEncoding="s" offsetX="0.3538512271910753">:+j&amp;;&amp;-^&gt;.7xf\jZ1,xb</iframe>
<style id="htmlvar00014" nonce="nonce" media="screen and (min-width:0px)" onerror="eventhandler1()" onload="eventhandler1()" dir="N5!" updateRangeEnd="0" abbr="4IvGMN[Wxd" symbols="=d##y#)DA4V8ya}KO.cv" frameBorder="^b*]&amp;:|#lB:" search="N">ynFXo*</style>
<iframe id="iframe" onunload="eventhandler3()" border="0" srcdoc="A#:^;&lt;gV&lt;&gt;8" style=":{,J" referrerpolicy="unsafe-url" background="!xp&gt;" nohref="nohref" nonce="nonce" inputEncoding="s" offsetX="0.3538512271910753">:+j&amp;;&amp;-^&gt;.7xf\jZ1,xb</iframe>
<style nonce="nonce" media="screen and (min-width:0px)" onerror="eventhandler1()" onload="eventhandler1()" dir="N5!" updateRangeEnd="0" abbr="4IvGMN[Wxd" symbols="=d##y#)DA4V8ya}KO.cv" frameBorder="^b*]&amp;:|#lB:" search="N">ynFXo*</style>
</body>
</html>

Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<!DOCTYPE html>
<html class=reftest-wait>
<html class=test-wait>
<title>View transitions: entry animation from root display none</title>
<link rel="help" href="https://drafts.csswg.org/css-view-transitions-1/">
<link rel="author" href="mailto:[email protected]">

<script src="/common/reftest-wait.js"></script>
<style>
.hidden {
display: none;
Expand All @@ -15,16 +14,14 @@
</style>

<script>
failIfNot(document.startViewTransition, "Missing document.startViewTransition");

async function runTest() {
transition = document.startViewTransition();
transition.ready.then(
transition.ready.then(() => {
requestAnimationFrame(() => {
document.documentElement.classList.toggle("hidden");
}));
transition.finished.then(takeScreenshot);
});
});
transition.finished.then(() => document.documentElement.classList.remove("test-wait"));
}
onload = () => requestAnimationFrame(() => requestAnimationFrame(runTest));
</script>

0 comments on commit 6ae7875

Please sign in to comment.