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

Unified Diff: Source/core/animation/AnimationTest.cpp

Issue 142523005: Web Animations: Define easing for each keyframe (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: Rename s_accuracy to accuracyForKeyframeEasing Created 6 years, 10 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 | « Source/core/animation/Animation.cpp ('k') | Source/core/animation/KeyframeEffectModel.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/animation/AnimationTest.cpp
diff --git a/Source/core/animation/AnimationTest.cpp b/Source/core/animation/AnimationTest.cpp
index a7bda9e5aeff35633d0cb4a6bd20dfffa1dbacc9..2785126fcfff9875dd387ba8e10915e9ed7c81f0 100644
--- a/Source/core/animation/AnimationTest.cpp
+++ b/Source/core/animation/AnimationTest.cpp
@@ -105,8 +105,10 @@ TEST_F(AnimationAnimationTest, CanCreateAnAnimation)
setV8ObjectPropertyAsString(keyframe1, "width", "100px");
setV8ObjectPropertyAsString(keyframe1, "offset", "0");
+ setV8ObjectPropertyAsString(keyframe1, "easing", "ease-in-out");
setV8ObjectPropertyAsString(keyframe2, "width", "0px");
setV8ObjectPropertyAsString(keyframe2, "offset", "1");
+ setV8ObjectPropertyAsString(keyframe2, "easing", "cubic-bezier(1, 1, 0.3, 0.3)");
jsKeyframes.append(Dictionary(keyframe1, isolate));
jsKeyframes.append(Dictionary(keyframe2, isolate));
@@ -140,6 +142,9 @@ TEST_F(AnimationAnimationTest, CanCreateAnAnimation)
EXPECT_EQ("100px", toAnimatableLength(keyframe1Width)->toCSSValue()->cssText());
EXPECT_EQ("0px", toAnimatableLength(keyframe2Width)->toCSSValue()->cssText());
+
+ EXPECT_EQ(*(CubicBezierTimingFunction::preset(CubicBezierTimingFunction::EaseInOut)), *keyframes[0]->easing());
+ EXPECT_EQ(*(CubicBezierTimingFunction::create(1, 1, 0.3, 0.3).get()), *keyframes[1]->easing());
}
TEST_F(AnimationAnimationTest, CanSetDuration)
« no previous file with comments | « Source/core/animation/Animation.cpp ('k') | Source/core/animation/KeyframeEffectModel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698