mirror of
https://github.com/servo/servo.git
synced 2025-08-04 05:00:08 +01:00
Update web-platform-tests to revision be5419e845d39089ba6dc338c1bd0fa279108317
This commit is contained in:
parent
aa199307c8
commit
2b6f573eb5
3440 changed files with 109438 additions and 41750 deletions
|
@ -0,0 +1,157 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset=utf-8>
|
||||
<title>Play states</title>
|
||||
<link rel="help" href="https://drafts.csswg.org/web-animations/#play-state">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="../../testcommon.js"></script>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
test(t => {
|
||||
const animation = new Animation(
|
||||
new KeyframeEffect(null, {}, 100 * MS_PER_SEC)
|
||||
);
|
||||
assert_equals(animation.currentTime, null,
|
||||
'Current time should be initially unresolved');
|
||||
|
||||
assert_equals(animation.playState, 'idle');
|
||||
}, 'reports \'idle\' for an animation with an unresolved current time'
|
||||
+ ' and no pending tasks')
|
||||
|
||||
test(t => {
|
||||
const div = createDiv(t);
|
||||
const animation = div.animate({}, 100 * MS_PER_SEC);
|
||||
|
||||
animation.pause();
|
||||
|
||||
assert_equals(animation.playState, 'paused');
|
||||
}, 'reports \'paused\' for an animation with a pending pause task');
|
||||
|
||||
test(t => {
|
||||
const animation = new Animation(
|
||||
new KeyframeEffect(null, {}, 100 * MS_PER_SEC)
|
||||
);
|
||||
|
||||
animation.currentTime = 0;
|
||||
assert_equals(animation.startTime, null,
|
||||
'Start time should still be unresolved after setting current'
|
||||
+ ' time');
|
||||
|
||||
assert_equals(animation.playState, 'paused');
|
||||
}, 'reports \'paused\' for an animation with a resolved current time and'
|
||||
+ ' unresolved start time')
|
||||
|
||||
test(t => {
|
||||
const animation = new Animation(
|
||||
new KeyframeEffect(null, {}, 100 * MS_PER_SEC)
|
||||
);
|
||||
|
||||
animation.startTime = document.timeline.currentTime;
|
||||
assert_not_equals(animation.currentTime, null,
|
||||
'Current time should be resolved after setting start time');
|
||||
|
||||
assert_equals(animation.playState, 'running');
|
||||
}, 'reports \'running\' for an animation with a resolved start time and'
|
||||
+ ' current time');
|
||||
|
||||
test(t => {
|
||||
const animation = new Animation(
|
||||
new KeyframeEffect(null, {}, 100 * MS_PER_SEC)
|
||||
);
|
||||
animation.startTime = document.timeline.currentTime;
|
||||
|
||||
animation.currentTime = 100 * MS_PER_SEC;
|
||||
|
||||
assert_equals(animation.playState, 'finished');
|
||||
}, 'reports \'finished\' when playback rate > 0 and'
|
||||
+ ' current time = target effect end');
|
||||
|
||||
test(t => {
|
||||
const animation = new Animation(
|
||||
new KeyframeEffect(null, {}, 100 * MS_PER_SEC)
|
||||
);
|
||||
animation.startTime = document.timeline.currentTime;
|
||||
|
||||
animation.playbackRate = 0;
|
||||
animation.currentTime = 100 * MS_PER_SEC;
|
||||
|
||||
assert_equals(animation.playState, 'running');
|
||||
}, 'reports \'running\' when playback rate = 0 and'
|
||||
+ ' current time = target effect end');
|
||||
|
||||
test(t => {
|
||||
const animation = new Animation(
|
||||
new KeyframeEffect(null, {}, 100 * MS_PER_SEC)
|
||||
);
|
||||
animation.startTime = document.timeline.currentTime;
|
||||
|
||||
animation.playbackRate = -1;
|
||||
animation.currentTime = 100 * MS_PER_SEC;
|
||||
|
||||
assert_equals(animation.playState, 'running');
|
||||
}, 'reports \'running\' when playback rate < 0 and'
|
||||
+ ' current time = target effect end');
|
||||
|
||||
test(t => {
|
||||
const animation = new Animation(
|
||||
new KeyframeEffect(null, {}, 100 * MS_PER_SEC)
|
||||
);
|
||||
animation.startTime = document.timeline.currentTime;
|
||||
|
||||
animation.currentTime = 0;
|
||||
|
||||
assert_equals(animation.playState, 'running');
|
||||
}, 'reports \'running\' when playback rate > 0 and'
|
||||
+ ' current time = 0');
|
||||
|
||||
test(t => {
|
||||
const animation = new Animation(
|
||||
new KeyframeEffect(null, {}, 100 * MS_PER_SEC)
|
||||
);
|
||||
animation.startTime = document.timeline.currentTime;
|
||||
|
||||
animation.playbackRate = 0;
|
||||
animation.currentTime = 0;
|
||||
|
||||
assert_equals(animation.playState, 'running');
|
||||
}, 'reports \'running\' when playback rate = 0 and'
|
||||
+ ' current time = 0');
|
||||
|
||||
test(t => {
|
||||
const animation = new Animation(
|
||||
new KeyframeEffect(null, {}, 100 * MS_PER_SEC)
|
||||
);
|
||||
animation.startTime = document.timeline.currentTime;
|
||||
|
||||
animation.playbackRate = -1;
|
||||
animation.currentTime = 0;
|
||||
|
||||
assert_equals(animation.playState, 'finished');
|
||||
}, 'reports \'finished\' when playback rate < 0 and'
|
||||
+ ' current time = 0');
|
||||
|
||||
test(t => {
|
||||
const div = createDiv(t);
|
||||
const animation = div.animate({}, 0);
|
||||
assert_equals(animation.startTime, null,
|
||||
'Sanity check: start time should be unresolved');
|
||||
|
||||
assert_equals(animation.playState, 'finished');
|
||||
}, 'reports \'finished\' when playback rate > 0 and'
|
||||
+ ' current time = target effect end and there is a pending play task');
|
||||
|
||||
test(t => {
|
||||
const div = createDiv(t);
|
||||
const animation = div.animate({}, 100 * MS_PER_SEC);
|
||||
assert_equals(animation.startTime, null,
|
||||
'Sanity check: start time should be unresolved');
|
||||
|
||||
assert_equals(animation.playState, 'running');
|
||||
}, 'reports \'running\' when playback rate > 0 and'
|
||||
+ ' current time < target effect end and there is a pending play task');
|
||||
|
||||
</script>
|
||||
</body>
|
Loading…
Add table
Add a link
Reference in a new issue