| Index: third_party/WebKit/LayoutTests/imported/wpt/web-animations/interfaces/Animatable/animate.html
|
| diff --git a/third_party/WebKit/LayoutTests/imported/wpt/web-animations/animatable/animate.html b/third_party/WebKit/LayoutTests/imported/wpt/web-animations/interfaces/Animatable/animate.html
|
| similarity index 62%
|
| rename from third_party/WebKit/LayoutTests/imported/wpt/web-animations/animatable/animate.html
|
| rename to third_party/WebKit/LayoutTests/imported/wpt/web-animations/interfaces/Animatable/animate.html
|
| index 2cf3ef2024324c3520fdf8d16dbe859ba29f0e00..9e571cb99cf95e88d216fe91041ca9c55366c3b9 100644
|
| --- a/third_party/WebKit/LayoutTests/imported/wpt/web-animations/animatable/animate.html
|
| +++ b/third_party/WebKit/LayoutTests/imported/wpt/web-animations/interfaces/Animatable/animate.html
|
| @@ -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">
|
| -<script src="../../../../resources/testharness.js"></script>
|
| -<script src="../../../../resources/testharnessreport.js"></script>
|
| -<script src="../testcommon.js"></script>
|
| +<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.
|
| -
|
| -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');
|
| -
|
| -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.
|
| +gPropertyIndexedKeyframesTests.forEach(function(subtest) {
|
| + test(function(t) {
|
| + var div = createDiv(t);
|
| + var anim = div.animate(subtest.input, 2000);
|
| + assert_frame_lists_equal(anim.effect.getKeyframes(), subtest.output);
|
| + }, 'Element.animate() accepts ' + subtest.desc);
|
| +});
|
| +
|
| +gKeyframeSequenceTests.forEach(function(subtest) {
|
| + test(function(t) {
|
| + var div = createDiv(t);
|
| + var anim = div.animate(subtest.input, 2000);
|
| + assert_frame_lists_equal(anim.effect.getKeyframes(), subtest.output);
|
| + }, 'Element.animate() accepts ' + subtest.desc);
|
| +});
|
| +
|
| +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 ' +
|
|
|