gecko-dev/testing/web-platform/tests/animation-worklet/worklet-animation-start-delay.https.html
Jordan Taylor f784d39a3f Bug 1533996 [wpt PR 15690] - [Animation Worklet] Upstream web tests (related to creation, duration, start-delay, and cancel) to WPT, a=testonly
Automatic update from web-platform-tests
[Animation Worklet] Upstream web tests (related to creation, duration, start-delay, and cancel) to WPT

web_tests/animations/animationworklet/worklet-animation-cancel.html -> web_tests/external/wpt/animation-worklet/worklet-animation-cancel.https.html

web_tests/animations/animationworklet/worklet-animation-cancel-expected.html -> web_tests/external/wpt/animation-worklet/worklet-animation-cancel-ref.html

web_tests/animations/animationworklet/worklet-animation-creation.html -> web_tests/external/wpt/animation-worklet/worklet-animation-creation.https.html

web_tests/animations/animationworklet/worklet-animation-duration.html -> web_tests/external/wpt/animation-worklet/worklet-animation-duration.https.html

web_tests/animations/animationworklet/worklet-animation-duration-expected.html -> web_tests/external/wpt/animation-worklet/worklet-animation-duration-ref.html

web_tests/animations/animationworklet/worklet-animation-start-delay.html -> web_tests/external/wpt/animation-worklet/worklet-animation-start-delay.https.html

web_tests/animations/animationworklet/worklet-animation-start-delay-expected.html -> web_tests/external/wpt/animation-worklet/worklet-animation-start-delay-ref.html

Bug: 915352
Change-Id: I7e0fb6a9d0158ba2c1809c0a7ba25d87136cf405
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1504701
Reviewed-by: Yi Gu <yigu@chromium.org>
Commit-Queue: Jordan Taylor <jortaylo@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#639960}

--

wpt-commits: 328607f6d4fd446e92106e6054e260ebe581a9de
wpt-pr: 15690
2019-04-01 14:43:22 +01:00

64 lines
1.7 KiB
HTML

<html class="reftest-wait">
<title>WorkletAnimation should respect delay given in options</title>
<link rel="help" href="https://drafts.css-houdini.org/css-animationworklet/">
<meta name="assert" content="Worklet Animation should respect delay given in options">
<link rel="match" href="worklet-animation-start-delay-ref.html">
<script src="/web-animations/testcommon.js"></script>
<script src="/common/reftest-wait.js"></script>
<script src="common.js"></script>
<style>
.box {
width: 100px;
height: 100px;
background-color: green;
}
</style>
<div id="t0" class="box"></div>
<div id="t1" class="box"></div>
<div id="out"></div>
<script id="visual_update" type="text/worklet">
registerAnimator("t0_animator", class {
animate(currentTime, effect) {
effect.localTime = 500;
}
});
registerAnimator("t1_animator", class {
animate(currentTime, effect) {
effect.localTime = 5500;
}
});
</script>
<script>
runInAnimationWorklet(
document.getElementById('visual_update').textContent
).then(()=>{
const keyframes = [
{transform: 'translateX(0)' },
{transform: 'translateX(200px)' }
];
const options = {
duration: 1000,
delay: 5000,
};
const $t0 = document.getElementById('t0');
const $t0_effect = new KeyframeEffect($t0, keyframes, options);
const $t0_animation = new WorkletAnimation('t0_animator', $t0_effect);
const $t1 = document.getElementById('t1');
const $t1_effect = new KeyframeEffect($t1, keyframes, options);
const $t1_animation = new WorkletAnimation('t1_animator', $t1_effect);
$t0_animation.play();
$t1_animation.play();
waitForAsyncAnimationFrames(1).then(_ => {
takeScreenshot();
});
});
</script>