| Index: cc/keyframed_animation_curve_unittest.cc
|
| diff --git a/cc/keyframed_animation_curve_unittest.cc b/cc/keyframed_animation_curve_unittest.cc
|
| index 9dca26aeabb402298e51d02535d98a250b9b0117..044dca7315631dc582a2d0b93f93923d61d22ee4 100644
|
| --- a/cc/keyframed_animation_curve_unittest.cc
|
| +++ b/cc/keyframed_animation_curve_unittest.cc
|
| @@ -22,10 +22,10 @@ void expectTranslateX(double translateX, const WebTransformationMatrix& matrix)
|
| }
|
|
|
| // Tests that a float animation with one keyframe works as expected.
|
| -TEST(CCKeyframedAnimationCurveTest, OneFloatKeyframe)
|
| +TEST(KeyframedAnimationCurveTest, OneFloatKeyframe)
|
| {
|
| - scoped_ptr<CCKeyframedFloatAnimationCurve> curve(CCKeyframedFloatAnimationCurve::create());
|
| - curve->addKeyframe(CCFloatKeyframe::create(0, 2, scoped_ptr<CCTimingFunction>()));
|
| + scoped_ptr<KeyframedFloatAnimationCurve> curve(KeyframedFloatAnimationCurve::create());
|
| + curve->addKeyframe(FloatKeyframe::create(0, 2, scoped_ptr<TimingFunction>()));
|
| EXPECT_FLOAT_EQ(2, curve->getValue(-1));
|
| EXPECT_FLOAT_EQ(2, curve->getValue(0));
|
| EXPECT_FLOAT_EQ(2, curve->getValue(0.5));
|
| @@ -34,11 +34,11 @@ TEST(CCKeyframedAnimationCurveTest, OneFloatKeyframe)
|
| }
|
|
|
| // Tests that a float animation with two keyframes works as expected.
|
| -TEST(CCKeyframedAnimationCurveTest, TwoFloatKeyframe)
|
| +TEST(KeyframedAnimationCurveTest, TwoFloatKeyframe)
|
| {
|
| - scoped_ptr<CCKeyframedFloatAnimationCurve> curve(CCKeyframedFloatAnimationCurve::create());
|
| - curve->addKeyframe(CCFloatKeyframe::create(0, 2, scoped_ptr<CCTimingFunction>()));
|
| - curve->addKeyframe(CCFloatKeyframe::create(1, 4, scoped_ptr<CCTimingFunction>()));
|
| + scoped_ptr<KeyframedFloatAnimationCurve> curve(KeyframedFloatAnimationCurve::create());
|
| + curve->addKeyframe(FloatKeyframe::create(0, 2, scoped_ptr<TimingFunction>()));
|
| + curve->addKeyframe(FloatKeyframe::create(1, 4, scoped_ptr<TimingFunction>()));
|
| EXPECT_FLOAT_EQ(2, curve->getValue(-1));
|
| EXPECT_FLOAT_EQ(2, curve->getValue(0));
|
| EXPECT_FLOAT_EQ(3, curve->getValue(0.5));
|
| @@ -47,12 +47,12 @@ TEST(CCKeyframedAnimationCurveTest, TwoFloatKeyframe)
|
| }
|
|
|
| // Tests that a float animation with three keyframes works as expected.
|
| -TEST(CCKeyframedAnimationCurveTest, ThreeFloatKeyframe)
|
| +TEST(KeyframedAnimationCurveTest, ThreeFloatKeyframe)
|
| {
|
| - scoped_ptr<CCKeyframedFloatAnimationCurve> curve(CCKeyframedFloatAnimationCurve::create());
|
| - curve->addKeyframe(CCFloatKeyframe::create(0, 2, scoped_ptr<CCTimingFunction>()));
|
| - curve->addKeyframe(CCFloatKeyframe::create(1, 4, scoped_ptr<CCTimingFunction>()));
|
| - curve->addKeyframe(CCFloatKeyframe::create(2, 8, scoped_ptr<CCTimingFunction>()));
|
| + scoped_ptr<KeyframedFloatAnimationCurve> curve(KeyframedFloatAnimationCurve::create());
|
| + curve->addKeyframe(FloatKeyframe::create(0, 2, scoped_ptr<TimingFunction>()));
|
| + curve->addKeyframe(FloatKeyframe::create(1, 4, scoped_ptr<TimingFunction>()));
|
| + curve->addKeyframe(FloatKeyframe::create(2, 8, scoped_ptr<TimingFunction>()));
|
| EXPECT_FLOAT_EQ(2, curve->getValue(-1));
|
| EXPECT_FLOAT_EQ(2, curve->getValue(0));
|
| EXPECT_FLOAT_EQ(3, curve->getValue(0.5));
|
| @@ -63,13 +63,13 @@ TEST(CCKeyframedAnimationCurveTest, ThreeFloatKeyframe)
|
| }
|
|
|
| // Tests that a float animation with multiple keys at a given time works sanely.
|
| -TEST(CCKeyframedAnimationCurveTest, RepeatedFloatKeyTimes)
|
| +TEST(KeyframedAnimationCurveTest, RepeatedFloatKeyTimes)
|
| {
|
| - scoped_ptr<CCKeyframedFloatAnimationCurve> curve(CCKeyframedFloatAnimationCurve::create());
|
| - curve->addKeyframe(CCFloatKeyframe::create(0, 4, scoped_ptr<CCTimingFunction>()));
|
| - curve->addKeyframe(CCFloatKeyframe::create(1, 4, scoped_ptr<CCTimingFunction>()));
|
| - curve->addKeyframe(CCFloatKeyframe::create(1, 6, scoped_ptr<CCTimingFunction>()));
|
| - curve->addKeyframe(CCFloatKeyframe::create(2, 6, scoped_ptr<CCTimingFunction>()));
|
| + scoped_ptr<KeyframedFloatAnimationCurve> curve(KeyframedFloatAnimationCurve::create());
|
| + curve->addKeyframe(FloatKeyframe::create(0, 4, scoped_ptr<TimingFunction>()));
|
| + curve->addKeyframe(FloatKeyframe::create(1, 4, scoped_ptr<TimingFunction>()));
|
| + curve->addKeyframe(FloatKeyframe::create(1, 6, scoped_ptr<TimingFunction>()));
|
| + curve->addKeyframe(FloatKeyframe::create(2, 6, scoped_ptr<TimingFunction>()));
|
|
|
| EXPECT_FLOAT_EQ(4, curve->getValue(-1));
|
| EXPECT_FLOAT_EQ(4, curve->getValue(0));
|
| @@ -86,12 +86,12 @@ TEST(CCKeyframedAnimationCurveTest, RepeatedFloatKeyTimes)
|
|
|
|
|
| // Tests that a transform animation with one keyframe works as expected.
|
| -TEST(CCKeyframedAnimationCurveTest, OneTransformKeyframe)
|
| +TEST(KeyframedAnimationCurveTest, OneTransformKeyframe)
|
| {
|
| - scoped_ptr<CCKeyframedTransformAnimationCurve> curve(CCKeyframedTransformAnimationCurve::create());
|
| + scoped_ptr<KeyframedTransformAnimationCurve> curve(KeyframedTransformAnimationCurve::create());
|
| WebKit::WebTransformOperations operations;
|
| operations.appendTranslate(2, 0, 0);
|
| - curve->addKeyframe(CCTransformKeyframe::create(0, operations, scoped_ptr<CCTimingFunction>()));
|
| + curve->addKeyframe(TransformKeyframe::create(0, operations, scoped_ptr<TimingFunction>()));
|
|
|
| expectTranslateX(2, curve->getValue(-1));
|
| expectTranslateX(2, curve->getValue(0));
|
| @@ -101,16 +101,16 @@ TEST(CCKeyframedAnimationCurveTest, OneTransformKeyframe)
|
| }
|
|
|
| // Tests that a transform animation with two keyframes works as expected.
|
| -TEST(CCKeyframedAnimationCurveTest, TwoTransformKeyframe)
|
| +TEST(KeyframedAnimationCurveTest, TwoTransformKeyframe)
|
| {
|
| - scoped_ptr<CCKeyframedTransformAnimationCurve> curve(CCKeyframedTransformAnimationCurve::create());
|
| + scoped_ptr<KeyframedTransformAnimationCurve> curve(KeyframedTransformAnimationCurve::create());
|
| WebKit::WebTransformOperations operations1;
|
| operations1.appendTranslate(2, 0, 0);
|
| WebKit::WebTransformOperations operations2;
|
| operations2.appendTranslate(4, 0, 0);
|
|
|
| - curve->addKeyframe(CCTransformKeyframe::create(0, operations1, scoped_ptr<CCTimingFunction>()));
|
| - curve->addKeyframe(CCTransformKeyframe::create(1, operations2, scoped_ptr<CCTimingFunction>()));
|
| + curve->addKeyframe(TransformKeyframe::create(0, operations1, scoped_ptr<TimingFunction>()));
|
| + curve->addKeyframe(TransformKeyframe::create(1, operations2, scoped_ptr<TimingFunction>()));
|
| expectTranslateX(2, curve->getValue(-1));
|
| expectTranslateX(2, curve->getValue(0));
|
| expectTranslateX(3, curve->getValue(0.5));
|
| @@ -119,18 +119,18 @@ TEST(CCKeyframedAnimationCurveTest, TwoTransformKeyframe)
|
| }
|
|
|
| // Tests that a transform animation with three keyframes works as expected.
|
| -TEST(CCKeyframedAnimationCurveTest, ThreeTransformKeyframe)
|
| +TEST(KeyframedAnimationCurveTest, ThreeTransformKeyframe)
|
| {
|
| - scoped_ptr<CCKeyframedTransformAnimationCurve> curve(CCKeyframedTransformAnimationCurve::create());
|
| + scoped_ptr<KeyframedTransformAnimationCurve> curve(KeyframedTransformAnimationCurve::create());
|
| WebKit::WebTransformOperations operations1;
|
| operations1.appendTranslate(2, 0, 0);
|
| WebKit::WebTransformOperations operations2;
|
| operations2.appendTranslate(4, 0, 0);
|
| WebKit::WebTransformOperations operations3;
|
| operations3.appendTranslate(8, 0, 0);
|
| - curve->addKeyframe(CCTransformKeyframe::create(0, operations1, scoped_ptr<CCTimingFunction>()));
|
| - curve->addKeyframe(CCTransformKeyframe::create(1, operations2, scoped_ptr<CCTimingFunction>()));
|
| - curve->addKeyframe(CCTransformKeyframe::create(2, operations3, scoped_ptr<CCTimingFunction>()));
|
| + curve->addKeyframe(TransformKeyframe::create(0, operations1, scoped_ptr<TimingFunction>()));
|
| + curve->addKeyframe(TransformKeyframe::create(1, operations2, scoped_ptr<TimingFunction>()));
|
| + curve->addKeyframe(TransformKeyframe::create(2, operations3, scoped_ptr<TimingFunction>()));
|
| expectTranslateX(2, curve->getValue(-1));
|
| expectTranslateX(2, curve->getValue(0));
|
| expectTranslateX(3, curve->getValue(0.5));
|
| @@ -141,9 +141,9 @@ TEST(CCKeyframedAnimationCurveTest, ThreeTransformKeyframe)
|
| }
|
|
|
| // Tests that a transform animation with multiple keys at a given time works sanely.
|
| -TEST(CCKeyframedAnimationCurveTest, RepeatedTransformKeyTimes)
|
| +TEST(KeyframedAnimationCurveTest, RepeatedTransformKeyTimes)
|
| {
|
| - scoped_ptr<CCKeyframedTransformAnimationCurve> curve(CCKeyframedTransformAnimationCurve::create());
|
| + scoped_ptr<KeyframedTransformAnimationCurve> curve(KeyframedTransformAnimationCurve::create());
|
| // A step function.
|
| WebKit::WebTransformOperations operations1;
|
| operations1.appendTranslate(4, 0, 0);
|
| @@ -153,10 +153,10 @@ TEST(CCKeyframedAnimationCurveTest, RepeatedTransformKeyTimes)
|
| operations3.appendTranslate(6, 0, 0);
|
| WebKit::WebTransformOperations operations4;
|
| operations4.appendTranslate(6, 0, 0);
|
| - curve->addKeyframe(CCTransformKeyframe::create(0, operations1, scoped_ptr<CCTimingFunction>()));
|
| - curve->addKeyframe(CCTransformKeyframe::create(1, operations2, scoped_ptr<CCTimingFunction>()));
|
| - curve->addKeyframe(CCTransformKeyframe::create(1, operations3, scoped_ptr<CCTimingFunction>()));
|
| - curve->addKeyframe(CCTransformKeyframe::create(2, operations4, scoped_ptr<CCTimingFunction>()));
|
| + curve->addKeyframe(TransformKeyframe::create(0, operations1, scoped_ptr<TimingFunction>()));
|
| + curve->addKeyframe(TransformKeyframe::create(1, operations2, scoped_ptr<TimingFunction>()));
|
| + curve->addKeyframe(TransformKeyframe::create(1, operations3, scoped_ptr<TimingFunction>()));
|
| + curve->addKeyframe(TransformKeyframe::create(2, operations4, scoped_ptr<TimingFunction>()));
|
|
|
| expectTranslateX(4, curve->getValue(-1));
|
| expectTranslateX(4, curve->getValue(0));
|
| @@ -172,12 +172,12 @@ TEST(CCKeyframedAnimationCurveTest, RepeatedTransformKeyTimes)
|
| }
|
|
|
| // Tests that the keyframes may be added out of order.
|
| -TEST(CCKeyframedAnimationCurveTest, UnsortedKeyframes)
|
| +TEST(KeyframedAnimationCurveTest, UnsortedKeyframes)
|
| {
|
| - scoped_ptr<CCKeyframedFloatAnimationCurve> curve(CCKeyframedFloatAnimationCurve::create());
|
| - curve->addKeyframe(CCFloatKeyframe::create(2, 8, scoped_ptr<CCTimingFunction>()));
|
| - curve->addKeyframe(CCFloatKeyframe::create(0, 2, scoped_ptr<CCTimingFunction>()));
|
| - curve->addKeyframe(CCFloatKeyframe::create(1, 4, scoped_ptr<CCTimingFunction>()));
|
| + scoped_ptr<KeyframedFloatAnimationCurve> curve(KeyframedFloatAnimationCurve::create());
|
| + curve->addKeyframe(FloatKeyframe::create(2, 8, scoped_ptr<TimingFunction>()));
|
| + curve->addKeyframe(FloatKeyframe::create(0, 2, scoped_ptr<TimingFunction>()));
|
| + curve->addKeyframe(FloatKeyframe::create(1, 4, scoped_ptr<TimingFunction>()));
|
| EXPECT_FLOAT_EQ(2, curve->getValue(-1));
|
| EXPECT_FLOAT_EQ(2, curve->getValue(0));
|
| EXPECT_FLOAT_EQ(3, curve->getValue(0.5));
|
| @@ -188,11 +188,11 @@ TEST(CCKeyframedAnimationCurveTest, UnsortedKeyframes)
|
| }
|
|
|
| // Tests that a cubic bezier timing function works as expected.
|
| -TEST(CCKeyframedAnimationCurveTest, CubicBezierTimingFunction)
|
| +TEST(KeyframedAnimationCurveTest, CubicBezierTimingFunction)
|
| {
|
| - scoped_ptr<CCKeyframedFloatAnimationCurve> curve(CCKeyframedFloatAnimationCurve::create());
|
| - curve->addKeyframe(CCFloatKeyframe::create(0, 0, CCCubicBezierTimingFunction::create(0.25, 0, 0.75, 1).PassAs<CCTimingFunction>()));
|
| - curve->addKeyframe(CCFloatKeyframe::create(1, 1, scoped_ptr<CCTimingFunction>()));
|
| + scoped_ptr<KeyframedFloatAnimationCurve> curve(KeyframedFloatAnimationCurve::create());
|
| + curve->addKeyframe(FloatKeyframe::create(0, 0, CubicBezierTimingFunction::create(0.25, 0, 0.75, 1).PassAs<TimingFunction>()));
|
| + curve->addKeyframe(FloatKeyframe::create(1, 1, scoped_ptr<TimingFunction>()));
|
|
|
| EXPECT_FLOAT_EQ(0, curve->getValue(0));
|
| EXPECT_LT(0, curve->getValue(0.25));
|
|
|