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

Unified Diff: content/renderer/input/input_handler_proxy_unittest.cc

Issue 792833002: Use Blink's flag to prevent fling boosting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Unit test added Created 6 years 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 | « content/renderer/input/input_handler_proxy.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/input/input_handler_proxy_unittest.cc
diff --git a/content/renderer/input/input_handler_proxy_unittest.cc b/content/renderer/input/input_handler_proxy_unittest.cc
index aafe9187371cceb5f7ce7f84c8fe6ede3342792c..cb85701ec9dd30c531965a6330ea504458d4c36e 100644
--- a/content/renderer/input/input_handler_proxy_unittest.cc
+++ b/content/renderer/input/input_handler_proxy_unittest.cc
@@ -1954,6 +1954,26 @@ TEST_F(InputHandlerProxyTest, NoFlingBoostIfFlingTooSlow) {
VERIFY_AND_RESET_MOCKS();
}
+TEST_F(InputHandlerProxyTest, NoFlingBoostIfPreventBoostingFlagIsSet) {
+ base::TimeDelta dt = base::TimeDelta::FromMilliseconds(10);
+ base::TimeTicks time = base::TimeTicks() + dt;
+ WebFloatPoint fling_delta = WebFloatPoint(1000, 0);
+ WebPoint fling_point = WebPoint(7, 13);
+
+ StartFling(
+ time, blink::WebGestureDeviceTouchscreen, fling_delta, fling_point);
+
+ EXPECT_CALL(mock_input_handler_, ScrollEnd());
+
+ // Cancel the fling. The fling cancellation should not be deferred because of
+ // prevent boosting flag set.
+ gesture_.data.flingCancel.preventBoosting = true;
+ time += dt;
+ CancelFling(time);
+
+ // VERIFY_AND_RESET_MOCKS already called by CancelFling
+}
+
TEST_F(InputHandlerProxyTest, FlingBoostTerminatedDuringScrollSequence) {
base::TimeDelta dt = base::TimeDelta::FromMilliseconds(10);
base::TimeTicks time = base::TimeTicks() + dt;
« no previous file with comments | « content/renderer/input/input_handler_proxy.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698