mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-11 05:39:41 +02:00
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
40 lines
1.4 KiB
HTML
40 lines
1.4 KiB
HTML
<html>
|
|
<title>WorkletAnimation should continue to be in effect forever, even if its duration is passed</title>
|
|
<link rel="help" href="https://drafts.css-houdini.org/css-animationworklet/">
|
|
<link rel="match" href="worklet-animation-duration-ref.html">
|
|
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
<script src="/web-animations/testcommon.js"></script>
|
|
<script src="common.js"></script>
|
|
|
|
<div id="box"></div>
|
|
|
|
<script>
|
|
promise_test(async t => {
|
|
await registerConstantLocalTimeAnimator(0.5);
|
|
|
|
const box = document.getElementById('box');
|
|
const effect = new KeyframeEffect(box,
|
|
[
|
|
{transform: 'translateY(0px)' },
|
|
{transform: 'translateY(200px)' }
|
|
], {
|
|
duration: 1,
|
|
}
|
|
);
|
|
|
|
const animation = new WorkletAnimation('constant_time', effect);
|
|
animation.play();
|
|
|
|
let expected_transform = "matrix(1, 0, 0, 1, 0, 100)";
|
|
await waitForAnimationFrameWithCondition(_ => {
|
|
return getComputedStyle(box).transform == expected_transform;
|
|
});
|
|
|
|
// The animation is specified to last for 1 millisecond
|
|
await new Promise(resolve => step_timeout(resolve, 500));
|
|
|
|
assert_equals(getComputedStyle(document.getElementById("box")).transform, expected_transform);
|
|
}, "WorkletAnimation should continue to be in effect forever, even if its duration is passed");
|
|
</script>
|