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

Unified Diff: LayoutTests/web-animations-api/element-animate-list-of-keyframes.html

Issue 251463003: Web Animations API: Sort keyframes by offset (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: move Keyframe::compareOffsets out of KeyframeEffectModel.cpp Created 6 years, 8 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
« no previous file with comments | « no previous file | Source/core/animation/EffectInput.cpp » ('j') | Source/core/animation/ElementAnimation.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 35c06e8e94dbd660dfbd4eb1b061f4f6e3d0eb3b..8f3b6fed197ae5a64c614852f38932099fbfa991 100644
--- a/LayoutTests/web-animations-api/element-animate-list-of-keyframes.html
+++ b/LayoutTests/web-animations-api/element-animate-list-of-keyframes.html
@@ -50,6 +50,26 @@ test(function() {
assert_equals(e2Style.backgroundColor, 'rgb(64, 64, 64)');
}, 'Calling animate() should start an animation. CamelCase property names should be parsed.');
+test(function() {
+ var player = e1.animate([
+ {opacity: '0.75', offset: 0.5},
+ {opacity: '0.9', offset: 1},
+ {opacity: '1', offset: 0}
+ ], durationValue);
+ player.pause();
+ player.currentTime = durationValue / 4;
+ assert_equals(e1Style.opacity, '0.875');
alancutter (OOO until 2018) 2014/04/28 10:53:46 It's not very easy to tell that this is the correc
Eric Willigers 2014/04/29 00:14:49 Done.
+}, 'Keyframes with offsets should become sorted by offset.');
+
+test(function() {
+ var keyframes = [
+ {opacity: '0.75'},
+ {opacity: '0.9', offset: 1},
+ {opacity: '1', offset: 0}
+ ];
+ assert_throws('InvalidModificationError', function() { e1.animate(keyframes, durationValue); });
+}, 'Should throw when keyframes are not loosely sorted and any have no offset.');
+
var keyframesWithInvalid = [
{width: '0px', backgroundColor: 'octarine', offset: 0},
{width: '1000px', foo: 'bar', offset: 1}];
« no previous file with comments | « no previous file | Source/core/animation/EffectInput.cpp » ('j') | Source/core/animation/ElementAnimation.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698