Index: LayoutTests/web-animations-api/animation-constructor.html |
diff --git a/LayoutTests/web-animations-api/animation-constructor.html b/LayoutTests/web-animations-api/animation-constructor.html |
index 0a679cdabdda1dc950c33d88cbdd84ce1870bcc6..a4fdf420283fa8ed0741308618ca4c3f154c0e65 100644 |
--- a/LayoutTests/web-animations-api/animation-constructor.html |
+++ b/LayoutTests/web-animations-api/animation-constructor.html |
@@ -9,32 +9,44 @@ |
<script> |
var element = document.getElementById('e'); |
-var animationWithTimingObject = new Animation(element, |
- [{opacity: '1', offset: 0}, |
- {opacity: '0', offset: 1}], |
- {duration: 2, iterations: 5}); |
- |
-var animationWithDuration = new Animation(element, |
- [{opacity: '1', offset: 0}, |
- {opacity: '0', offset: 1}], |
- 2); |
- |
-var animationNoTiming = new Animation(element, |
- [{opacity: '1', offset: 0}, |
- {opacity: '0', offset: 1}]); |
- |
test(function() { |
+ var animationWithTimingObject = new Animation(element, |
+ [{opacity: '1', offset: 0}, |
+ {opacity: '0', offset: 1}], |
+ {duration: 2, iterations: 5}); |
+ |
assert_false(animationWithTimingObject == undefined); |
assert_equals(animationWithTimingObject.constructor, Animation); |
}, 'Calling new Animation() with a timing object input should create an animation.'); |
test(function() { |
+ var animationWithDuration = new Animation(element, |
+ [{opacity: '1', offset: 0}, |
+ {opacity: '0', offset: 1}], |
+ 2); |
+ |
assert_false(animationWithDuration == undefined); |
assert_equals(animationWithDuration.constructor, Animation); |
}, 'Calling new Animation() with a duration input should create an animation.'); |
test(function() { |
+ var animationNoTiming = new Animation(element, |
+ [{opacity: '1', offset: 0}, |
+ {opacity: '0', offset: 1}]); |
+ |
assert_false(animationNoTiming == undefined); |
assert_equals(animationNoTiming.constructor, Animation); |
}, 'Calling new Animation() with no timing input should create an animation.'); |
-</script> |
+ |
+test(function() { |
+ var partialKeyframes1 = [ |
+ {opacity: '1', color: 'red', offset: 0}, |
+ {opacity: '0', offset: 1}]; |
+ var partialKeyframes2 = [ |
+ {opacity: '1', color: 'red', offset: 0}, |
+ {opacity: '0', color: 'foo', offset: 1}]; |
+ |
+ assert_throws('NOT_SUPPORTED_ERR', function() { new Animation(element, partialKeyframes1); }); |
+ assert_throws('NOT_SUPPORTED_ERR', function() { new Animation(element, partialKeyframes2); }); |
+}, 'Calling new Animation() with a partial keyframe should throw a NotSupportedError.'); |
+</script> |