summaryrefslogtreecommitdiff
path: root/Source/WebKit/chromium/tests/PlatformGestureCurveTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebKit/chromium/tests/PlatformGestureCurveTest.cpp')
-rw-r--r--Source/WebKit/chromium/tests/PlatformGestureCurveTest.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/Source/WebKit/chromium/tests/PlatformGestureCurveTest.cpp b/Source/WebKit/chromium/tests/PlatformGestureCurveTest.cpp
index 9bda21764..0e83a84e1 100644
--- a/Source/WebKit/chromium/tests/PlatformGestureCurveTest.cpp
+++ b/Source/WebKit/chromium/tests/PlatformGestureCurveTest.cpp
@@ -99,13 +99,15 @@ TEST(PlatformGestureCurve, flingCurveTouch)
{
double initialVelocity = 5000;
MockPlatformGestureCurveTarget target;
- OwnPtr<ActivePlatformGestureAnimation> animation = ActivePlatformGestureAnimation::create(TouchFlingPlatformGestureCurve::createForTouchPad(FloatPoint(initialVelocity, 0)), &target);
+ // Explicitly parametrized to make test non-brittle in face of
+ // parameter changes.
+ OwnPtr<ActivePlatformGestureAnimation> animation = ActivePlatformGestureAnimation::create(TouchFlingPlatformGestureCurve::create(FloatPoint(initialVelocity, 0), -5.70762e+03f, 1.72e+02f, 3.7e+00f, 1.3f), &target);
- // Note: the expectations below are dependent on the value of sigma hard-coded in the curve parameters.
- // If the parameters change, then the tests values/expectations will need to be updated.
+ // Note: the expectations below are dependent on the curve parameters hard
+ // coded into the create call above.
EXPECT_TRUE(animation->animate(0));
EXPECT_TRUE(animation->animate(0.25));
- EXPECT_TRUE(animation->animate(0.45)); // Use non-uniform tick spacing.
+ EXPECT_TRUE(animation->animate(0.45f)); // Use non-uniform tick spacing.
EXPECT_TRUE(animation->animate(1));
EXPECT_FALSE(animation->animate(1.5));
EXPECT_NEAR(target.cumulativeDelta().x(), 1193, 1);