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

Unified Diff: LayoutTests/web-animations-api/element-animate-list-of-keyframes.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/element-animate-list-of-keyframes.html
diff --git a/LayoutTests/web-animations-api/element-animate-list-of-keyframes.html b/LayoutTests/web-animations-api/element-animate-list-of-keyframes.html
index 4bb195f8db39f61b02b862d739bf1e81e6f311c7..bf64ff9177b91df5b11474bdeda1299734277437 100644
--- a/LayoutTests/web-animations-api/element-animate-list-of-keyframes.html
+++ b/LayoutTests/web-animations-api/element-animate-list-of-keyframes.html
@@ -16,12 +16,14 @@
<div id='e1' class='anim'></div>
<div id='e2' class='anim'></div>
<div id='e3' class='anim'></div>
+ <div id='e4' class='anim'></div>
</body>
<script>
var e1 = document.getElementById('e1');
var e2 = document.getElementById('e2');
var e3 = document.getElementById('e3');
+var e4 = document.getElementById('e4');
var e1Style = getComputedStyle(e1);
var e2Style = getComputedStyle(e2);
@@ -64,4 +66,17 @@ test(function() {
assert_equals(e3Style.backgroundColor, 'rgb(0, 0, 0)');
assert_equals(e3Style.foo, undefined);
}, 'Calling animate() with a pre-constructed keyframes list should start an animation. Invalid style declarations should be ignored.');
+
+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() { e4.animate(partialKeyframes1, durationValue); });
+ assert_throws('NOT_SUPPORTED_ERR', function() { e4.animate(partialKeyframes2, durationValue); });
+}, 'Calling animate() with a partial keyframe should throw a NotSupportedError.');
</script>

Powered by Google App Engine
This is Rietveld 408576698