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

Unified Diff: ui/events/blink/input_handler_proxy_unittest.cc

Issue 2744243009: [Compositor event queue] FlingCancel should clear on-going gesture flag (Closed)
Patch Set: Created 3 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 | « ui/events/blink/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: ui/events/blink/input_handler_proxy_unittest.cc
diff --git a/ui/events/blink/input_handler_proxy_unittest.cc b/ui/events/blink/input_handler_proxy_unittest.cc
index a9b6b2af14c58498788bfa3df7641eb46c4e1dfe..51660ff0f4b30780c6efcfccc817f6078363aaf5 100644
--- a/ui/events/blink/input_handler_proxy_unittest.cc
+++ b/ui/events/blink/input_handler_proxy_unittest.cc
@@ -3583,6 +3583,41 @@ TEST_F(InputHandlerProxyEventQueueTest, GestureScrollFlingOrder) {
!input_handler_proxy_->gesture_scroll_on_impl_thread_for_testing());
}
+TEST_F(InputHandlerProxyEventQueueTest, GestureScrollAfterFling) {
+ // Handle scroll on compositor.
+ cc::InputHandlerScrollResult scroll_result_did_scroll_;
+ scroll_result_did_scroll_.did_scroll = true;
+
+ EXPECT_CALL(mock_input_handler_, ScrollBegin(testing::_, testing::_))
+ .WillRepeatedly(testing::Return(kImplThreadScrollState));
+ EXPECT_CALL(mock_input_handler_, SetNeedsAnimateInput())
+ .Times(::testing::AtLeast(1));
+ EXPECT_CALL(
+ mock_input_handler_,
+ ScrollBy(testing::Property(&cc::ScrollState::delta_y, testing::Gt(0))))
+ .WillRepeatedly(testing::Return(scroll_result_did_scroll_));
+ EXPECT_CALL(mock_input_handler_, ScrollEnd(testing::_))
+ .Times(::testing::AtLeast(1));
+
+ // Simulate fling.
+ HandleGestureEvent(WebInputEvent::GestureScrollBegin);
+ HandleGestureEvent(WebInputEvent::GestureScrollUpdate, -20);
+ HandleGestureEvent(WebInputEvent::GestureFlingStart, -10);
+ HandleGestureEvent(WebInputEvent::GestureFlingCancel);
+
+ // Dispatch events.
+ input_handler_proxy_->DeliverInputForBeginFrame();
+ EXPECT_EQ(0ul, event_queue().size());
+ EXPECT_EQ(4ul, event_disposition_recorder_.size());
+ EXPECT_FALSE(
+ input_handler_proxy_->gesture_scroll_on_impl_thread_for_testing());
+
+ // New ScrollBegin should be dispatched immediately as there is no on-going
+ // scroll, fling or pinch.
+ HandleGestureEvent(WebInputEvent::GestureScrollBegin);
+ EXPECT_EQ(0ul, event_queue().size());
+}
+
INSTANTIATE_TEST_CASE_P(AnimateInput,
InputHandlerProxyTest,
testing::ValuesIn(test_types));
« no previous file with comments | « ui/events/blink/input_handler_proxy.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698