| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <meta charset=utf-8> | |
| 3 <title>Animation constructor tests</title> | |
| 4 <link rel="help" href="http://w3c.github.io/web-animations/#dom-animation-animat
ion"> | |
| 5 <link rel="author" title="Hiroyuki Ikezoe" href="mailto:hiikezoe@mozilla-japan.o
rg"> | |
| 6 <script src="../../../../resources/testharness.js"></script> | |
| 7 <script src="../../../../resources/testharnessreport.js"></script> | |
| 8 <script src="../testcommon.js"></script> | |
| 9 <body> | |
| 10 <div id="log"></div> | |
| 11 <div id="target"></div> | |
| 12 <script> | |
| 13 "use strict"; | |
| 14 | |
| 15 var gTarget = document.getElementById("target"); | |
| 16 var gEffect = new KeyframeEffectReadOnly(gTarget, { opacity: [0, 1] }); | |
| 17 | |
| 18 var gTestArguments = [ | |
| 19 { | |
| 20 effect: null, | |
| 21 timeline: null, | |
| 22 description: "with null effect and null timeline" | |
| 23 }, | |
| 24 { | |
| 25 effect: null, | |
| 26 timeline: document.timeline, | |
| 27 description: "with null effect and non-null timeline" | |
| 28 }, | |
| 29 { | |
| 30 effect: gEffect, | |
| 31 timeline: null, | |
| 32 description: "with non-null effect and null timeline" | |
| 33 }, | |
| 34 { | |
| 35 effect: gEffect, | |
| 36 timeline: document.timeline, | |
| 37 description: "with non-null effect and non-null timeline" | |
| 38 }, | |
| 39 ]; | |
| 40 | |
| 41 gTestArguments.forEach(function(args) { | |
| 42 test(function(t) { | |
| 43 var animation = new Animation(args.effect, args.timeline); | |
| 44 | |
| 45 assert_not_equals(animation, null, | |
| 46 "An animation sohuld be created"); | |
| 47 assert_equals(animation.effect, args.effect, | |
| 48 "Animation returns the same effect passed to " + | |
| 49 "the Constructor"); | |
| 50 assert_equals(animation.timeline, args.timeline, | |
| 51 "Animation returns the same timeline passed to " + | |
| 52 "the Constructor"); | |
| 53 assert_equals(animation.playState, "idle", | |
| 54 "Animation.playState should be initially 'idle'"); | |
| 55 }, "Animation can be constructed " + args.description); | |
| 56 }); | |
| 57 | |
| 58 </script> | |
| 59 </body> | |
| OLD | NEW |