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

Unified Diff: Source/WebKit/chromium/tests/PlatformGestureCurveTest.cpp

Issue 9969140: Merge 113095 - [chromium] Switch touchpad fling curve physics to absolute (not scaled) curve. (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1084/
Patch Set: Created 8 years, 9 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 | « Source/WebKit/chromium/ChangeLog ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebKit/chromium/tests/PlatformGestureCurveTest.cpp
===================================================================
--- Source/WebKit/chromium/tests/PlatformGestureCurveTest.cpp (revision 113130)
+++ Source/WebKit/chromium/tests/PlatformGestureCurveTest.cpp (working copy)
@@ -99,21 +99,18 @@
TEST(PlatformGestureCurve, flingCurveTouch)
{
- double initialVelocity = 1000;
- const double touchFlingCurveAreaFactor = 1; // Depends on parameterization in TouchpadFlingPlatformGestureCurve.
+ double initialVelocity = 5000;
MockPlatformGestureCurveTarget target;
OwnPtr<ActivePlatformGestureAnimation> animation = ActivePlatformGestureAnimation::create(TouchpadFlingPlatformGestureCurve::create(FloatPoint(initialVelocity, 0)), &target);
- // Note: the expectations below are dependent on the value of sigma hard-coded in the Rayleigh
- // curve. If sigma changes, these test expectations will also change.
+ // 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.
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.75));
- EXPECT_TRUE(animation->animate(0.9));
- EXPECT_TRUE(animation->animate(1000));
- EXPECT_FALSE(animation->animate(1001));
- EXPECT_NEAR(target.cumulativeDelta().x(), initialVelocity * touchFlingCurveAreaFactor, 1);
+ EXPECT_TRUE(animation->animate(1));
+ EXPECT_FALSE(animation->animate(1.5));
+ EXPECT_NEAR(target.cumulativeDelta().x(), 1094, 1);
EXPECT_EQ(target.cumulativeDelta().y(), 0);
}
« no previous file with comments | « Source/WebKit/chromium/ChangeLog ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698