Update web-platform-tests to revision 7a767a52741f628430ffbbed46e7f3df68ba3534

Fixes #15648.
This commit is contained in:
Ms2ger 2017-02-20 11:44:42 +01:00
parent a1e4c547f0
commit 4fadf9b0b6
1184 changed files with 22551 additions and 9856 deletions

View file

@ -5,6 +5,7 @@
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../../testcommon.js"></script>
<script src="../../resources/easing-tests.js"></script>
<script src="../../resources/keyframe-utils.js"></script>
<body>
<div id="log"></div>
@ -96,6 +97,15 @@ gInvalidKeyframesTests.forEach(function(subtest) {
}, 'Element.animate() does not accept ' + subtest.desc);
});
gInvalidEasings.forEach(invalidEasing => {
test(function(t) {
var div = createDiv(t);
assert_throws(new TypeError, () => {
div.animate({ easing: invalidEasing }, 2000);
});
}, `Element.animate() does not accept invalid easing: '${invalidEasing}'`);
});
test(function(t) {
var div = createDiv(t);
var anim = div.animate({ opacity: [ 0, 1 ] }, 2000);

View file

@ -0,0 +1,70 @@
<!DOCTYPE html>
<meta charset=utf-8>
<title>Animatable.getAnimations tests</title>
<link rel="help" href="https://w3c.github.io/web-animations/#dom-animatable-getanimations">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../../testcommon.js"></script>
<body>
<script>
'use strict';
test(function(t) {
var div = createDiv(t);
assert_array_equals(div.getAnimations(), []);
}, 'Test getAnimations on 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);
assert_array_equals(div.getAnimations(), [animationA, animationB]);
}, 'Test getAnimations on 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);
assert_array_equals(divA.getAnimations(), [animationA], 'divA');
assert_array_equals(divB.getAnimations(), [animationB], 'divB');
}, 'Test getAnimations on separate elements with separate animations');
test(function(t) {
var divParent = createDiv(t);
var 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');
assert_array_equals(divChild.getAnimations(), [animationChild], 'divChild');
}, 'Test getAnimations on parent and child elements with separate animations');
test(function(t) {
var div = createDiv(t);
var animation = div.animate(null, 100 * MS_PER_SEC);
animation.finish();
assert_array_equals(div.getAnimations(), []);
}, 'Test getAnimations on element with finished fill none animation');
test(function(t) {
var div = createDiv(t);
var 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');
test(function(t) {
var div = createDiv(t);
var 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');
</script>
</body>