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

Unified Diff: cc/animation/keyframed_animation_curve_unittest.cc

Issue 2032643003: CC Animation: Erase EaseTimingFunction helpers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gmock
Patch Set: Created 4 years, 7 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 | « cc/animation/element_animations_unittest.cc ('k') | cc/animation/scroll_offset_animation_curve.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/animation/keyframed_animation_curve_unittest.cc
diff --git a/cc/animation/keyframed_animation_curve_unittest.cc b/cc/animation/keyframed_animation_curve_unittest.cc
index b0010441ab74c69400a35a438f00c7d8458a09c4..9f63a87e3ea64cc2ddec4f7684a185961b5e25d2 100644
--- a/cc/animation/keyframed_animation_curve_unittest.cc
+++ b/cc/animation/keyframed_animation_curve_unittest.cc
@@ -548,9 +548,10 @@ TEST(KeyframedAnimationCurveTest, AnimatedBounds) {
base::TimeDelta::FromSecondsD(0.5f), operations1, nullptr));
TransformOperations operations2;
operations2.AppendTranslate(4.0, 1.0, 2.0);
- curve->AddKeyframe(
- TransformKeyframe::Create(base::TimeDelta::FromSecondsD(1.f), operations2,
- EaseTimingFunction::Create()));
+ curve->AddKeyframe(TransformKeyframe::Create(
+ base::TimeDelta::FromSecondsD(1.f), operations2,
+ CubicBezierTimingFunction::CreatePreset(
+ CubicBezierTimingFunction::EaseType::EASE)));
gfx::BoxF box(2.f, 3.f, 4.f, 1.f, 3.f, 2.f);
gfx::BoxF bounds;
@@ -631,9 +632,10 @@ TEST(KeyframedAnimationCurveTest, MaximumTargetScale) {
curve->AddKeyframe(
TransformKeyframe::Create(base::TimeDelta(), operations1, nullptr));
operations1.AppendScale(2.f, -3.f, 1.f);
- curve->AddKeyframe(
- TransformKeyframe::Create(base::TimeDelta::FromSecondsD(1.f), operations1,
- EaseTimingFunction::Create()));
+ curve->AddKeyframe(TransformKeyframe::Create(
+ base::TimeDelta::FromSecondsD(1.f), operations1,
+ CubicBezierTimingFunction::CreatePreset(
+ CubicBezierTimingFunction::EaseType::EASE)));
float maximum_scale = 0.f;
EXPECT_TRUE(curve->MaximumTargetScale(true, &maximum_scale));
@@ -641,18 +643,20 @@ TEST(KeyframedAnimationCurveTest, MaximumTargetScale) {
TransformOperations operations2;
operations2.AppendScale(6.f, 3.f, 2.f);
- curve->AddKeyframe(
- TransformKeyframe::Create(base::TimeDelta::FromSecondsD(2.f), operations2,
- EaseTimingFunction::Create()));
+ curve->AddKeyframe(TransformKeyframe::Create(
+ base::TimeDelta::FromSecondsD(2.f), operations2,
+ CubicBezierTimingFunction::CreatePreset(
+ CubicBezierTimingFunction::EaseType::EASE)));
EXPECT_TRUE(curve->MaximumTargetScale(true, &maximum_scale));
EXPECT_EQ(6.f, maximum_scale);
TransformOperations operations3;
operations3.AppendRotate(1.f, 0.f, 0.f, 90.f);
- curve->AddKeyframe(
- TransformKeyframe::Create(base::TimeDelta::FromSecondsD(3.f), operations3,
- EaseTimingFunction::Create()));
+ curve->AddKeyframe(TransformKeyframe::Create(
+ base::TimeDelta::FromSecondsD(3.f), operations3,
+ CubicBezierTimingFunction::CreatePreset(
+ CubicBezierTimingFunction::EaseType::EASE)));
EXPECT_FALSE(curve->MaximumTargetScale(true, &maximum_scale));
@@ -662,13 +666,16 @@ TEST(KeyframedAnimationCurveTest, MaximumTargetScale) {
TransformOperations operations4;
operations4.AppendScale(0.4f, 0.2f, 0.6f);
- curve2->AddKeyframe(TransformKeyframe::Create(base::TimeDelta(), operations4,
- EaseTimingFunction::Create()));
+ curve2->AddKeyframe(TransformKeyframe::Create(
+ base::TimeDelta(), operations4,
+ CubicBezierTimingFunction::CreatePreset(
+ CubicBezierTimingFunction::EaseType::EASE)));
TransformOperations operations5;
operations5.AppendScale(0.5f, 0.3f, -0.8f);
- curve2->AddKeyframe(
- TransformKeyframe::Create(base::TimeDelta::FromSecondsD(1.f), operations5,
- EaseTimingFunction::Create()));
+ curve2->AddKeyframe(TransformKeyframe::Create(
+ base::TimeDelta::FromSecondsD(1.f), operations5,
+ CubicBezierTimingFunction::CreatePreset(
+ CubicBezierTimingFunction::EaseType::EASE)));
EXPECT_TRUE(curve2->MaximumTargetScale(true, &maximum_scale));
EXPECT_EQ(0.8f, maximum_scale);
@@ -686,9 +693,10 @@ TEST(KeyframedAnimationCurveTest, AnimationStartScale) {
curve->AddKeyframe(
TransformKeyframe::Create(base::TimeDelta(), operations1, nullptr));
operations1.AppendScale(2.f, -3.f, 1.f);
- curve->AddKeyframe(
- TransformKeyframe::Create(base::TimeDelta::FromSecondsD(1.f), operations1,
- EaseTimingFunction::Create()));
+ curve->AddKeyframe(TransformKeyframe::Create(
+ base::TimeDelta::FromSecondsD(1.f), operations1,
+ CubicBezierTimingFunction::CreatePreset(
+ CubicBezierTimingFunction::EaseType::EASE)));
float start_scale = 0.f;
@@ -702,9 +710,10 @@ TEST(KeyframedAnimationCurveTest, AnimationStartScale) {
TransformOperations operations2;
operations2.AppendScale(6.f, 3.f, 2.f);
- curve->AddKeyframe(
- TransformKeyframe::Create(base::TimeDelta::FromSecondsD(2.f), operations2,
- EaseTimingFunction::Create()));
+ curve->AddKeyframe(TransformKeyframe::Create(
+ base::TimeDelta::FromSecondsD(2.f), operations2,
+ CubicBezierTimingFunction::CreatePreset(
+ CubicBezierTimingFunction::EaseType::EASE)));
// Backward direction
EXPECT_TRUE(curve->AnimationStartScale(true, &start_scale));
@@ -716,9 +725,10 @@ TEST(KeyframedAnimationCurveTest, AnimationStartScale) {
TransformOperations operations3;
operations3.AppendRotate(1.f, 0.f, 0.f, 90.f);
- curve->AddKeyframe(
- TransformKeyframe::Create(base::TimeDelta::FromSecondsD(3.f), operations3,
- EaseTimingFunction::Create()));
+ curve->AddKeyframe(TransformKeyframe::Create(
+ base::TimeDelta::FromSecondsD(3.f), operations3,
+ CubicBezierTimingFunction::CreatePreset(
+ CubicBezierTimingFunction::EaseType::EASE)));
EXPECT_FALSE(curve->AnimationStartScale(false, &start_scale));
EXPECT_EQ(0.f, start_scale);
« no previous file with comments | « cc/animation/element_animations_unittest.cc ('k') | cc/animation/scroll_offset_animation_curve.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698