Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(266)

Unified Diff: LayoutTests/web-animations-api/animation-constructor.html

Issue 190763007: [WIP] Web Animations API: Constructing an Animation from partial keyframes throws a JS exception (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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>

Powered by Google App Engine
This is Rietveld 408576698