Commit 51802238 authored by Kevin Ellis's avatar Kevin Ellis Committed by Commit Bot

Fix test flakiness in reverse-running-animation

The animation was often finishing before the screenshot resulting in a
failure. Extended the duration of the animation and starting the
animation from the midpoint should address the flakiness without
needlessly extending the run time of the test.

Bug: 1029543
Change-Id: I32e7794ff77a3b26e7d7f260f80d4b00bbc9d6f4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1986212Reviewed-by: default avatarStephen McGruer <smcgruer@chromium.org>
Commit-Queue: Kevin Ellis <kevers@chromium.org>
Cr-Commit-Position: refs/heads/master@{#728253}
parent 44057dc0
......@@ -5,6 +5,7 @@
<title>reverse running animation</title>
<link rel="match" href="reverse-running-animation-ref.html">
<script src="/common/reftest-wait.js"></script>
<script src="../../testcommon.js"></script>
<style>
#box, #overlay {
/* Add a border to ensure that anti-aliasing does not leak blue pixels
......@@ -44,24 +45,25 @@
</p>
</body>
<script>
onload = function() {
onload = async function() {
// Double rAF to ensure that we are not bogged down during initialization
// and the compositor is ready.
requestAnimationFrame(() => {
requestAnimationFrame(() => {
waitForAnimationFrames(2).then(() => {
const elem = document.getElementById('box');
const anim = elem.animate([
{ transform: 'translateX(100px)' },
{ transform: 'translateX(100px)' },
{ transform: 'translateX(200px)' },
{ transform: 'translateX(100px)', offset: 0.49 },
{ transform: 'translateX(200px)', offset: 0.51 },
{ transform: 'translateX(200px)' }
], {
duration: 1000
duration: 10000,
});
setTimeout(() => {
anim.ready.then(() => {
anim.currentTime = 5000;
requestAnimationFrame(() => {
anim.reverse();
}, 500);
takeScreenshotDelayed(900);
takeScreenshotDelayed(1000);
});
});
});
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment