OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <script src="../resources/testharness.js"></script> | 2 <script src="../resources/testharness.js"></script> |
3 <script src="../resources/testharnessreport.js"></script> | 3 <script src="../resources/testharnessreport.js"></script> |
4 | 4 |
5 <div id='e'></div> | 5 <div id='e'></div> |
6 | 6 |
7 <script> | 7 <script> |
8 var element = document.getElementById('e'); | 8 var element = document.getElementById('e'); |
9 | 9 |
10 var keyframes = [{opacity: '1'}, {opacity: '0'}]; | 10 var keyframes = [{opacity: '1'}, {opacity: '0'}]; |
11 var timingObject = {duration: 2, iterations: 5}; | 11 var timingObject = {duration: 2, iterations: 5}; |
12 | 12 |
13 test(function() { | 13 test(function() { |
14 var animation = new Animation(element, keyframes, timingObject); | 14 var keyframeEffect = new KeyframeEffect(element, keyframes, timingObject); |
15 assert_not_equals(animation, undefined); | 15 assert_not_equals(keyframeEffect, undefined); |
16 assert_equals(animation.constructor, Animation); | 16 assert_equals(keyframeEffect.constructor, KeyframeEffect); |
17 }, 'Calling new Animation() with a timing object input should create an animatio
n.'); | 17 }, 'Calling new KeyframeEffect() with a timing object input should create an key
frameEffect.'); |
18 | 18 |
19 test(function() { | 19 test(function() { |
20 var animation = new Animation(element, keyframes, 2); | 20 var keyframeEffect = new KeyframeEffect(element, keyframes, 2); |
21 assert_not_equals(animation, undefined); | 21 assert_not_equals(keyframeEffect, undefined); |
22 assert_equals(animation.constructor, Animation); | 22 assert_equals(keyframeEffect.constructor, KeyframeEffect); |
23 }, 'Calling new Animation() with a duration input should create an animation.'); | 23 }, 'Calling new KeyframeEffect() with a duration input should create an keyframe
Effect.'); |
24 | 24 |
25 test(function() { | 25 test(function() { |
26 var animation = new Animation(element, keyframes); | 26 var keyframeEffect = new KeyframeEffect(element, keyframes); |
27 assert_not_equals(animation, undefined); | 27 assert_not_equals(keyframeEffect, undefined); |
28 assert_equals(animation.constructor, Animation); | 28 assert_equals(keyframeEffect.constructor, KeyframeEffect); |
29 }, 'Calling new Animation() with no timing input should create an animation.'); | 29 }, 'Calling new KeyframeEffect() with no timing input should create an keyframeE
ffect.'); |
30 | 30 |
31 test(function() { | 31 test(function() { |
32 var animation = new Animation(null, keyframes); | 32 var keyframeEffect = new KeyframeEffect(null, keyframes); |
33 assert_not_equals(animation, undefined); | 33 assert_not_equals(keyframeEffect, undefined); |
34 assert_equals(animation.constructor, Animation); | 34 assert_equals(keyframeEffect.constructor, KeyframeEffect); |
35 }, 'Calling new Animation() with no target should create an animation.'); | 35 }, 'Calling new KeyframeEffect() with no target should create an keyframeEffect.
'); |
36 </script> | 36 </script> |
OLD | NEW |