mirror of
https://github.com/servo/servo.git
synced 2025-08-16 19:05:33 +01:00
Update web-platform-tests to revision 192193581b6912818a0e3f2408f40f033a451a79
This commit is contained in:
parent
2cf9a00c99
commit
13bbfdb3eb
46 changed files with 1499 additions and 144 deletions
|
@ -0,0 +1,48 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset=utf-8>
|
||||
<title>The current time of a worklet animation</title>
|
||||
<link rel="help" href="https://drafts.css-houdini.org/css-animationworklet/">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/web-animations/testcommon.js"></script>
|
||||
<script src="common.js"></script>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
const DURATION = 10000; // ms
|
||||
const KEYFRAMES = { height : ['100px', '50px'] };
|
||||
|
||||
promise_test(async t => {
|
||||
await registerPassthroughAnimator();
|
||||
const animation =
|
||||
new WorkletAnimation('passthrough', new KeyframeEffect(createDiv(t),
|
||||
KEYFRAMES, DURATION), document.timeline);
|
||||
|
||||
animation.play();
|
||||
assert_equals(animation.currentTime, 0,
|
||||
'Current time returns the hold time set when entering the play-pending' +
|
||||
'state');
|
||||
}, 'The current time returns the hold time when set');
|
||||
|
||||
promise_test(async t => {
|
||||
await registerPassthroughAnimator();
|
||||
const animation =
|
||||
new WorkletAnimation('passthrough', new KeyframeEffect(createDiv(t),
|
||||
KEYFRAMES, DURATION), document.timeline);
|
||||
|
||||
// TODO(majidvp): We should use Animation.startTime here because the
|
||||
// animation may not immediately start.
|
||||
const startTime = document.timeline.currentTime;
|
||||
animation.play();
|
||||
await waitForNextFrame();
|
||||
const timelineTime = document.timeline.currentTime;
|
||||
assert_times_equal(animation.currentTime, (timelineTime - startTime));
|
||||
}, 'The current time is calculated from the timeline time and start time');
|
||||
|
||||
// TODO(majidvp): Add tests for playbackRate and animations that are not
|
||||
// associated with a timeline once these are supported in WorkletAnimation.
|
||||
// http://crbug.com/833846
|
||||
</script>
|
||||
</body>
|
Loading…
Add table
Add a link
Reference in a new issue