| 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 dd7f8695d8d54f2ee495b1dc2e2e256ac74a98c1..dc8f5e0555ec2b60c974163f5d7ddfbc68d2bdcf 100644
|
| --- a/cc/animation/keyframed_animation_curve_unittest.cc
|
| +++ b/cc/animation/keyframed_animation_curve_unittest.cc
|
| @@ -11,9 +11,10 @@
|
| namespace cc {
|
| namespace {
|
|
|
| -void expectTranslateX(double translateX, const gfx::Transform& transform)
|
| +static void ExpectTranslateX(double translate_x,
|
| + const gfx::Transform& transform)
|
| {
|
| - EXPECT_FLOAT_EQ(translateX, transform.matrix().getDouble(0, 3));
|
| + EXPECT_FLOAT_EQ(translate_x, transform.matrix().getDouble(0, 3));
|
| }
|
|
|
| // Tests that a float animation with one keyframe works as expected.
|
| @@ -104,11 +105,11 @@ TEST(KeyframedAnimationCurveTest, OneTransformKeyframe)
|
| curve->AddKeyframe(
|
| TransformKeyframe::Create(0.f, operations, scoped_ptr<TimingFunction>()));
|
|
|
| - expectTranslateX(2.f, curve->GetValue(-1.f));
|
| - expectTranslateX(2.f, curve->GetValue(0.f));
|
| - expectTranslateX(2.f, curve->GetValue(0.5f));
|
| - expectTranslateX(2.f, curve->GetValue(1.f));
|
| - expectTranslateX(2.f, curve->GetValue(2.f));
|
| + ExpectTranslateX(2.f, curve->GetValue(-1.f));
|
| + ExpectTranslateX(2.f, curve->GetValue(0.f));
|
| + ExpectTranslateX(2.f, curve->GetValue(0.5f));
|
| + ExpectTranslateX(2.f, curve->GetValue(1.f));
|
| + ExpectTranslateX(2.f, curve->GetValue(2.f));
|
| }
|
|
|
| // Tests that a transform animation with two keyframes works as expected.
|
| @@ -125,11 +126,11 @@ TEST(KeyframedAnimationCurveTest, TwoTransformKeyframe)
|
| 0.f, operations1, scoped_ptr<TimingFunction>()));
|
| curve->AddKeyframe(TransformKeyframe::Create(
|
| 1.f, operations2, scoped_ptr<TimingFunction>()));
|
| - expectTranslateX(2.f, curve->GetValue(-1.f));
|
| - expectTranslateX(2.f, curve->GetValue(0.f));
|
| - expectTranslateX(3.f, curve->GetValue(0.5f));
|
| - expectTranslateX(4.f, curve->GetValue(1.f));
|
| - expectTranslateX(4.f, curve->GetValue(2.f));
|
| + ExpectTranslateX(2.f, curve->GetValue(-1.f));
|
| + ExpectTranslateX(2.f, curve->GetValue(0.f));
|
| + ExpectTranslateX(3.f, curve->GetValue(0.5f));
|
| + ExpectTranslateX(4.f, curve->GetValue(1.f));
|
| + ExpectTranslateX(4.f, curve->GetValue(2.f));
|
| }
|
|
|
| // Tests that a transform animation with three keyframes works as expected.
|
| @@ -149,13 +150,13 @@ TEST(KeyframedAnimationCurveTest, ThreeTransformKeyframe)
|
| 1.f, operations2, scoped_ptr<TimingFunction>()));
|
| curve->AddKeyframe(TransformKeyframe::Create(
|
| 2.f, operations3, scoped_ptr<TimingFunction>()));
|
| - expectTranslateX(2.f, curve->GetValue(-1.f));
|
| - expectTranslateX(2.f, curve->GetValue(0.f));
|
| - expectTranslateX(3.f, curve->GetValue(0.5f));
|
| - expectTranslateX(4.f, curve->GetValue(1.f));
|
| - expectTranslateX(6.f, curve->GetValue(1.5f));
|
| - expectTranslateX(8.f, curve->GetValue(2.f));
|
| - expectTranslateX(8.f, curve->GetValue(3.f));
|
| + ExpectTranslateX(2.f, curve->GetValue(-1.f));
|
| + ExpectTranslateX(2.f, curve->GetValue(0.f));
|
| + ExpectTranslateX(3.f, curve->GetValue(0.5f));
|
| + ExpectTranslateX(4.f, curve->GetValue(1.f));
|
| + ExpectTranslateX(6.f, curve->GetValue(1.5f));
|
| + ExpectTranslateX(8.f, curve->GetValue(2.f));
|
| + ExpectTranslateX(8.f, curve->GetValue(3.f));
|
| }
|
|
|
| // Tests that a transform animation with multiple keys at a given time works
|
| @@ -182,18 +183,18 @@ TEST(KeyframedAnimationCurveTest, RepeatedTransformKeyTimes)
|
| curve->AddKeyframe(TransformKeyframe::Create(
|
| 2.f, operations4, scoped_ptr<TimingFunction>()));
|
|
|
| - expectTranslateX(4.f, curve->GetValue(-1.f));
|
| - expectTranslateX(4.f, curve->GetValue(0.f));
|
| - expectTranslateX(4.f, curve->GetValue(0.5f));
|
| + ExpectTranslateX(4.f, curve->GetValue(-1.f));
|
| + ExpectTranslateX(4.f, curve->GetValue(0.f));
|
| + ExpectTranslateX(4.f, curve->GetValue(0.5f));
|
|
|
| // There is a discontinuity at 1. Any value between 4 and 6 is valid.
|
| gfx::Transform value = curve->GetValue(1.f);
|
| EXPECT_TRUE(value.matrix().getDouble(0.f, 3.f) >= 4);
|
| EXPECT_TRUE(value.matrix().getDouble(0.f, 3.f) <= 6);
|
|
|
| - expectTranslateX(6.f, curve->GetValue(1.5f));
|
| - expectTranslateX(6.f, curve->GetValue(2.f));
|
| - expectTranslateX(6.f, curve->GetValue(3.f));
|
| + ExpectTranslateX(6.f, curve->GetValue(1.5f));
|
| + ExpectTranslateX(6.f, curve->GetValue(2.f));
|
| + ExpectTranslateX(6.f, curve->GetValue(3.f));
|
| }
|
|
|
| // Tests that the keyframes may be added out of order.
|
|
|