Index: cc/animation/scroll_offset_animation_curve_unittest.cc |
diff --git a/cc/animation/scroll_offset_animation_curve_unittest.cc b/cc/animation/scroll_offset_animation_curve_unittest.cc |
index 63445d965dc8a5f5971d80285d7d4037602a51fa..9b1623ae8860f6c6e11b429776a1f799eceb53aa 100644 |
--- a/cc/animation/scroll_offset_animation_curve_unittest.cc |
+++ b/cc/animation/scroll_offset_animation_curve_unittest.cc |
@@ -119,5 +119,24 @@ TEST(ScrollOffsetAnimationCurveTest, Clone) { |
EXPECT_NEAR(37.4168f, value.y(), 0.00015f); |
} |
+TEST(ScrollOffsetAnimationCurveTest, UpdateTarget) { |
+ gfx::Vector2dF initial_value(0.f, 0.f); |
+ gfx::Vector2dF target_value(0.f, 3600.f); |
+ scoped_ptr<ScrollOffsetAnimationCurve> curve( |
+ ScrollOffsetAnimationCurve::Create( |
+ target_value, EaseInOutTimingFunction::Create().Pass())); |
+ curve->SetInitialValue(initial_value); |
+ EXPECT_EQ(1.0, curve->Duration()); |
+ EXPECT_EQ(1800.0, curve->GetValue(0.5).y()); |
+ EXPECT_EQ(3600.0, curve->GetValue(1.0).y()); |
+ |
+ curve->UpdateTarget(0.5, gfx::Vector2dF(0.0, 9900.0)); |
+ |
+ EXPECT_EQ(2.0, curve->Duration()); |
+ EXPECT_EQ(1800.0, curve->GetValue(0.5).y()); |
+ EXPECT_NEAR(5566.49, curve->GetValue(1.0).y(), 0.01); |
+ EXPECT_EQ(9900.0, curve->GetValue(2.0).y()); |
ajuma
2014/07/16 20:35:23
Please add one more re-targeting here (to verify t
skobes
2014/07/16 21:10:48
Done.
|
+} |
+ |
} // namespace |
} // namespace cc |