Update web-platform-tests to revision be5419e845d39089ba6dc338c1bd0fa279108317

This commit is contained in:
Josh Matthews 2018-01-04 13:44:24 -05:00
parent aa199307c8
commit 2b6f573eb5
3440 changed files with 109438 additions and 41750 deletions

View file

@ -1,7 +1,7 @@
<!DOCTYPE html>
<meta charset=utf-8>
<title>Animatable.getAnimations tests</title>
<link rel="help" href="https://w3c.github.io/web-animations/#dom-animatable-getanimations">
<title>Animatable.getAnimations</title>
<link rel="help" href="https://drafts.csswg.org/web-animations/#dom-animatable-getanimations">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../../testcommon.js"></script>
@ -9,62 +9,148 @@
<script>
'use strict';
test(function(t) {
var div = createDiv(t);
test(t => {
const div = createDiv(t);
assert_array_equals(div.getAnimations(), []);
}, 'Test getAnimations on element with no animations');
}, 'Returns an empty array for an element with no animations');
test(function(t) {
var div = createDiv(t);
var animationA = div.animate(null, 100 * MS_PER_SEC);
var animationB = div.animate(null, 100 * MS_PER_SEC);
test(t => {
const div = createDiv(t);
const animationA = div.animate(null, 100 * MS_PER_SEC);
const animationB = div.animate(null, 100 * MS_PER_SEC);
assert_array_equals(div.getAnimations(), [animationA, animationB]);
}, 'Test getAnimations on element with two animations');
}, 'Returns both animations for an element with two animations');
test(function(t) {
var divA = createDiv(t);
var divB = createDiv(t);
var animationA = divA.animate(null, 100 * MS_PER_SEC);
var animationB = divB.animate(null, 100 * MS_PER_SEC);
test(t => {
const divA = createDiv(t);
const divB = createDiv(t);
const animationA = divA.animate(null, 100 * MS_PER_SEC);
const animationB = divB.animate(null, 100 * MS_PER_SEC);
assert_array_equals(divA.getAnimations(), [animationA], 'divA');
assert_array_equals(divB.getAnimations(), [animationB], 'divB');
}, 'Test getAnimations on separate elements with separate animations');
}, 'Returns only the animations specific to each sibling element');
test(function(t) {
var divParent = createDiv(t);
var divChild = createDiv(t);
test(t => {
const divParent = createDiv(t);
const divChild = createDiv(t);
divParent.appendChild(divChild);
var animationParent = divParent.animate(null, 100 * MS_PER_SEC);
var animationChild = divChild.animate(null, 100 * MS_PER_SEC);
assert_array_equals(divParent.getAnimations(), [animationParent], 'divParent');
const animationParent = divParent.animate(null, 100 * MS_PER_SEC);
const animationChild = divChild.animate(null, 100 * MS_PER_SEC);
assert_array_equals(divParent.getAnimations(), [animationParent],
'divParent');
assert_array_equals(divChild.getAnimations(), [animationChild], 'divChild');
}, 'Test getAnimations on parent and child elements with separate animations');
}, 'Returns only the animations specific to each parent/child element');
test(function(t) {
var div = createDiv(t);
var animation = div.animate(null, 100 * MS_PER_SEC);
test(t => {
const div = createDiv(t);
const animation = div.animate(null, 100 * MS_PER_SEC);
animation.finish();
assert_array_equals(div.getAnimations(), []);
}, 'Test getAnimations on element with finished fill none animation');
}, 'Does not return finished animations that do not fill forwards');
test(function(t) {
var div = createDiv(t);
var animation = div.animate(null, {
test(t => {
const div = createDiv(t);
const animation = div.animate(null, {
duration: 100 * MS_PER_SEC,
fill: 'forwards',
});
animation.finish();
assert_array_equals(div.getAnimations(), [animation]);
}, 'Test getAnimations on element with finished fill forwards animation');
}, 'Returns finished animations that fill forwards');
test(function(t) {
var div = createDiv(t);
var animation = div.animate(null, {
test(t => {
const div = createDiv(t);
const animation = div.animate(null, {
duration: 100 * MS_PER_SEC,
delay: 100 * MS_PER_SEC,
});
assert_array_equals(div.getAnimations(), [animation]);
}, 'Test getAnimations on element with delayed animation');
}, 'Returns animations in their delay phase');
test(t => {
const div = createDiv(t);
const animation = div.animate(null, 100 * MS_PER_SEC);
animation.finish();
assert_array_equals(div.getAnimations(), [],
'Animation should not be returned when it is finished');
animation.effect.timing.duration += 100 * MS_PER_SEC;
assert_array_equals(div.getAnimations(), [animation],
'Animation should be returned after extending the'
+ ' duration');
animation.effect.timing.duration = 0;
assert_array_equals(div.getAnimations(), [],
'Animation should not be returned after setting the'
+ ' duration to zero');
}, 'Returns animations based on dynamic changes to individual'
+ ' animations\' duration');
test(t => {
const div = createDiv(t);
const animation = div.animate(null, 100 * MS_PER_SEC);
animation.effect.timing.endDelay = -200 * MS_PER_SEC;
assert_array_equals(div.getAnimations(), [],
'Animation should not be returned after setting a'
+ ' negative end delay such that the end time is less'
+ ' than the current time');
animation.effect.timing.endDelay = 100 * MS_PER_SEC;
assert_array_equals(div.getAnimations(), [animation],
'Animation should be returned after setting a positive'
+ ' end delay such that the end time is more than the'
+ ' current time');
}, 'Returns animations based on dynamic changes to individual'
+ ' animations\' end delay');
test(t => {
const div = createDiv(t);
const animation = div.animate(null, 100 * MS_PER_SEC);
animation.finish();
assert_array_equals(div.getAnimations(), [],
'Animation should not be returned when it is finished');
animation.effect.timing.iterations = 10;
assert_array_equals(div.getAnimations(), [animation],
'Animation should be returned after inreasing the'
+ ' number of iterations');
animation.effect.timing.iterations = 0;
assert_array_equals(div.getAnimations(), [],
'Animations should not be returned after setting the'
+ ' iteration count to zero');
animation.effect.timing.iterations = Infinity;
assert_array_equals(div.getAnimations(), [animation],
'Animation should be returned after inreasing the'
+ ' number of iterations to infinity');
}, 'Returns animations based on dynamic changes to individual'
+ ' animations\' iteration count');
test(t => {
const div = createDiv(t);
const animation = div.animate(null,
{ duration: 100 * MS_PER_SEC,
delay: 50 * MS_PER_SEC,
endDelay: -50 * MS_PER_SEC });
assert_array_equals(div.getAnimations(), [animation],
'Animation should be returned at during delay phase');
animation.currentTime = 50 * MS_PER_SEC;
assert_array_equals(div.getAnimations(), [animation],
'Animation should be returned after seeking to the start'
+ ' of the active interval');
animation.currentTime = 100 * MS_PER_SEC;
assert_array_equals(div.getAnimations(), [],
'Animation should not be returned after seeking to the'
+ ' clipped end of the active interval');
}, 'Returns animations based on dynamic changes to individual'
+ ' animations\' current time');
</script>
</body>