Update web-platform-tests to revision 697b971060b2d475a73c1c3755232a4674d61cf5

This commit is contained in:
Ms2ger 2016-05-10 11:29:19 +02:00
parent f60598909a
commit b97474fbba
236 changed files with 4817 additions and 893 deletions

View file

@ -1,62 +1,55 @@
<!DOCTYPE html>
<meta charset=utf-8>
<title>Animatable.animate tests</title>
<link rel="help" href="http://w3c.github.io/web-animations/#dom-animatable-animate">
<link rel="author" title="Brian Birtles" href="mailto:bbirtles@mozilla.com">
<link rel="help" href="https://w3c.github.io/web-animations/#dom-animatable-animate">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../testcommon.js"></script>
<script src="../resources/keyframe-utils.js"></script>
<body>
<div id="log"></div>
<script>
'use strict';
// Tests on Element
test(function(t) {
var div = createDiv(t);
var anim = div.animate({ opacity: [ 0, 1 ] }, 2000);
var anim = div.animate(null);
assert_class_string(anim, 'Animation', 'Returned object is an Animation');
}, 'Element.animate() creates an Animation object');
test(function(t) {
var div = createDiv(t);
var anim = div.animate({ opacity: [ 0, 1 ] }, 2000);
var anim = div.animate(null);
assert_class_string(anim.effect, 'KeyframeEffect',
'Returned Animation has a KeyframeEffect');
}, 'Element.animate() creates an Animation object with a KeyframeEffect');
// Animatable.animate() passes its |frames| argument to the KeyframeEffect
// constructor. As a result, detailed tests of the handling of that argument
// are found in the tests for that constructor. Here we just check that the
// different types of arguments are correctly passed along.
gPropertyIndexedKeyframesTests.forEach(function(subtest) {
test(function(t) {
var div = createDiv(t);
var anim = div.animate(subtest.input, 2000);
assert_frame_lists_equal(anim.effect.getFrames(), subtest.output);
}, 'Element.animate() accepts ' + subtest.desc);
});
test(function(t) {
var div = createDiv(t);
var anim = div.animate({ opacity: [ 0, 1 ] }, 2000);
assert_equals(anim.effect.getFrames().length, 2);
assert_equals(anim.effect.getFrames()[0].opacity, '0');
assert_equals(anim.effect.getFrames()[1].opacity, '1');
}, 'Element.animate() accepts a property-indexed keyframe specification');
gKeyframeSequenceTests.forEach(function(subtest) {
test(function(t) {
var div = createDiv(t);
var anim = div.animate(subtest.input, 2000);
assert_frame_lists_equal(anim.effect.getFrames(), subtest.output);
}, 'Element.animate() accepts ' + subtest.desc);
});
test(function(t) {
var div = createDiv(t);
var anim = div.animate([ { opacity: 0 }, { opacity: 1 } ], 2000);
assert_equals(anim.effect.getFrames().length, 2);
assert_equals(anim.effect.getFrames()[0].opacity, '0');
assert_equals(anim.effect.getFrames()[1].opacity, '1');
}, 'Element.animate() accepts a frame-indexed keyframe specification');
test(function(t) {
var div = createDiv(t);
var anim = div.animate({ opacity: 0 }, 2000);
assert_equals(anim.effect.getFrames().length, 1);
assert_equals(anim.effect.getFrames()[0].opacity, '0');
}, 'Element.animate() accepts a single-valued keyframe specification');
// As with the |frames| argument, Animatable.animate() passes its |options|
// argument to the KeyframeEffect constructor as well. As a result, detailed
// tests of the handling of that argument are found in the tests for that
// constructor. Here we just check that the different types of arguments are
// correctly passed along.
gInvalidKeyframesTests.forEach(function(subtest) {
test(function(t) {
var div = createDiv(t);
assert_throws(subtest.expected, function() {
div.animate(subtest.input, 2000);
});
}, 'Element.animate() does not accept ' + subtest.desc);
});
test(function(t) {
var div = createDiv(t);
@ -127,13 +120,13 @@ test(function(t) {
test(function(t) {
var pseudoTarget = createPseudo(t, 'before');
var anim = pseudoTarget.animate({ opacity: [ 0, 1 ] }, 2000);
var anim = pseudoTarget.animate(null);
assert_class_string(anim, 'Animation', 'The returned object is an Animation');
}, 'CSSPseudoElement.animate() creates an Animation object');
test(function(t) {
var pseudoTarget = createPseudo(t, 'before');
var anim = pseudoTarget.animate({ opacity: [ 0, 1 ] }, 2000);
var anim = pseudoTarget.animate(null);
assert_equals(anim.effect.target, pseudoTarget,
'The returned Animation targets to the correct object');
}, 'CSSPseudoElement.animate() creates an Animation object targeting ' +