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

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

Issue 1028533004: Reset scroll status when a fling is ignored (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup Created 5 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 | « 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 f6369c3e18439b0fa6db286c576dc7871e2854b0..382536687ff248b91db8eb698fbb57e64db3ca7c 100644
--- a/content/renderer/input/input_handler_proxy_unittest.cc
+++ b/content/renderer/input/input_handler_proxy_unittest.cc
@@ -961,6 +961,8 @@ TEST_F(InputHandlerProxyTest, GestureFlingIgnoredTouchscreen) {
expected_disposition_ = InputHandlerProxy::DROP_EVENT;
VERIFY_AND_RESET_MOCKS();
+ // Flings ignored by the InputHandler should be dropped, signalling the end
+ // of the touch scroll sequence.
EXPECT_CALL(mock_input_handler_, FlingScrollBegin())
.WillOnce(testing::Return(cc::InputHandler::SCROLL_IGNORED));
@@ -970,9 +972,12 @@ TEST_F(InputHandlerProxyTest, GestureFlingIgnoredTouchscreen) {
VERIFY_AND_RESET_MOCKS();
- // Even if we didn't start a fling ourselves, we still need to send the cancel
- // event to the widget.
- gesture_.type = WebInputEvent::GestureFlingCancel;
+ // Subsequent scrolls should behave normally, even without an intervening
+ // GestureFlingCancel, as the original GestureFlingStart was dropped.
+ expected_disposition_ = InputHandlerProxy::DID_HANDLE;
+ EXPECT_CALL(mock_input_handler_, ScrollBegin(testing::_, testing::_))
+ .WillOnce(testing::Return(cc::InputHandler::SCROLL_STARTED));
+ gesture_.type = WebInputEvent::GestureScrollBegin;
gesture_.sourceDevice = blink::WebGestureDeviceTouchscreen;
EXPECT_EQ(expected_disposition_, input_handler_->HandleInputEvent(gesture_));
}
« 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