Index: content/browser/renderer_host/input/input_router_impl_unittest.cc |
diff --git a/content/browser/renderer_host/input/input_router_impl_unittest.cc b/content/browser/renderer_host/input/input_router_impl_unittest.cc |
index e376268c572042d6ec38157d9561f85dcde18f99..4dd9c9c67a7df79f26ec091ef1b2e190794d9a32 100644 |
--- a/content/browser/renderer_host/input/input_router_impl_unittest.cc |
+++ b/content/browser/renderer_host/input/input_router_impl_unittest.cc |
@@ -352,14 +352,6 @@ class InputRouterImplTest : public testing::Test { |
return input_router()->touch_event_queue_->IsAckTimeoutEnabled(); |
} |
- void RequestNotificationWhenFlushed() const { |
- return input_router_->RequestNotificationWhenFlushed(); |
- } |
- |
- size_t GetAndResetDidFlushCount() { |
- return client_->GetAndResetDidFlushCount(); |
- } |
- |
bool HasPendingEvents() const { |
return input_router_->HasPendingEvents(); |
} |
@@ -1789,121 +1781,6 @@ TEST_F(InputRouterImplRafAlignedTouchDisabledTest, |
EXPECT_EQ(0, client_->in_flight_event_count()); |
} |
-// Test that the router will call the client's |DidFlush| after all events have |
-// been dispatched following a call to |Flush|. |
-TEST_F(InputRouterImplTest, InputFlush) { |
- EXPECT_FALSE(HasPendingEvents()); |
- |
- // Flushing an empty router should immediately trigger DidFlush. |
- RequestNotificationWhenFlushed(); |
- EXPECT_EQ(1U, GetAndResetDidFlushCount()); |
- EXPECT_FALSE(HasPendingEvents()); |
- |
- // Queue a TouchStart. |
- OnHasTouchEventHandlers(true); |
- PressTouchPoint(1, 1); |
- uint32_t touch_press_event_id = SendTouchEvent(); |
- EXPECT_TRUE(HasPendingEvents()); |
- |
- // DidFlush should be called only after the event is ack'ed. |
- RequestNotificationWhenFlushed(); |
- EXPECT_EQ(0U, GetAndResetDidFlushCount()); |
- SendTouchEventACK(WebInputEvent::kTouchStart, |
- INPUT_EVENT_ACK_STATE_NOT_CONSUMED, touch_press_event_id); |
- EXPECT_EQ(1U, GetAndResetDidFlushCount()); |
- |
- // Ensure different types of enqueued events will prevent the DidFlush call |
- // until all such events have been fully dispatched. |
- MoveTouchPoint(0, 50, 50); |
- uint32_t touch_move_event_id = SendTouchEvent(); |
- ASSERT_TRUE(HasPendingEvents()); |
- SimulateGestureEvent(WebInputEvent::kGestureScrollBegin, |
- blink::kWebGestureDeviceTouchscreen); |
- SimulateGestureEvent(WebInputEvent::kGestureScrollUpdate, |
- blink::kWebGestureDeviceTouchscreen); |
- SimulateGestureEvent(WebInputEvent::kGesturePinchBegin, |
- blink::kWebGestureDeviceTouchscreen); |
- SimulateGestureEvent(WebInputEvent::kGesturePinchUpdate, |
- blink::kWebGestureDeviceTouchscreen); |
- RequestNotificationWhenFlushed(); |
- EXPECT_EQ(0U, GetAndResetDidFlushCount()); |
- |
- // Repeated flush calls should have no effect. |
- RequestNotificationWhenFlushed(); |
- EXPECT_EQ(0U, GetAndResetDidFlushCount()); |
- |
- // There are still pending gestures. |
- SendTouchEventACK(WebInputEvent::kTouchMove, |
- INPUT_EVENT_ACK_STATE_NOT_CONSUMED, touch_move_event_id); |
- EXPECT_EQ(0U, GetAndResetDidFlushCount()); |
- EXPECT_TRUE(HasPendingEvents()); |
- |
- // One more gesture to go. |
- SendInputEventACK(WebInputEvent::kGestureScrollUpdate, |
- INPUT_EVENT_ACK_STATE_CONSUMED); |
- EXPECT_EQ(0U, GetAndResetDidFlushCount()); |
- EXPECT_TRUE(HasPendingEvents()); |
- |
- // The final ack'ed gesture should trigger the DidFlush. |
- SendInputEventACK(WebInputEvent::kGesturePinchUpdate, |
- INPUT_EVENT_ACK_STATE_CONSUMED); |
- EXPECT_EQ(1U, GetAndResetDidFlushCount()); |
- EXPECT_FALSE(HasPendingEvents()); |
-} |
- |
-// Test that the router will call the client's |DidFlush| after all fling |
-// animations have completed. |
-TEST_F(InputRouterImplTest, InputFlushAfterFling) { |
- EXPECT_FALSE(HasPendingEvents()); |
- |
- // Simulate a fling. |
- SimulateGestureEvent(WebInputEvent::kGestureScrollBegin, |
- blink::kWebGestureDeviceTouchscreen); |
- SimulateGestureEvent(WebInputEvent::kGestureFlingStart, |
- blink::kWebGestureDeviceTouchscreen); |
- EXPECT_TRUE(HasPendingEvents()); |
- |
- // If the fling is unconsumed, the flush is complete. |
- RequestNotificationWhenFlushed(); |
- EXPECT_EQ(0U, GetAndResetDidFlushCount()); |
- SimulateGestureEvent(WebInputEvent::kGestureScrollBegin, |
- blink::kWebGestureDeviceTouchscreen); |
- SendInputEventACK(WebInputEvent::kGestureFlingStart, |
- INPUT_EVENT_ACK_STATE_NOT_CONSUMED); |
- EXPECT_FALSE(HasPendingEvents()); |
- EXPECT_EQ(1U, GetAndResetDidFlushCount()); |
- |
- // Simulate a second fling. |
- SimulateGestureEvent(WebInputEvent::kGestureFlingStart, |
- blink::kWebGestureDeviceTouchscreen); |
- EXPECT_TRUE(HasPendingEvents()); |
- |
- // If the fling is consumed, the flush is complete only when the renderer |
- // reports that is has ended. |
- RequestNotificationWhenFlushed(); |
- EXPECT_EQ(0U, GetAndResetDidFlushCount()); |
- SendInputEventACK(WebInputEvent::kGestureFlingStart, |
- INPUT_EVENT_ACK_STATE_CONSUMED); |
- EXPECT_TRUE(HasPendingEvents()); |
- EXPECT_EQ(0U, GetAndResetDidFlushCount()); |
- |
- // The fling end notification should signal that the router is flushed. |
- input_router()->OnMessageReceived(InputHostMsg_DidStopFlinging(0)); |
- EXPECT_EQ(1U, GetAndResetDidFlushCount()); |
- |
- // Even flings consumed by the client require a fling-end notification. |
- client_->set_filter_state(INPUT_EVENT_ACK_STATE_CONSUMED); |
- SimulateGestureEvent(WebInputEvent::kGestureScrollBegin, |
- blink::kWebGestureDeviceTouchscreen); |
- SimulateGestureEvent(WebInputEvent::kGestureFlingStart, |
- blink::kWebGestureDeviceTouchscreen); |
- ASSERT_TRUE(HasPendingEvents()); |
- RequestNotificationWhenFlushed(); |
- EXPECT_EQ(0U, GetAndResetDidFlushCount()); |
- input_router()->OnMessageReceived(InputHostMsg_DidStopFlinging(0)); |
- EXPECT_EQ(1U, GetAndResetDidFlushCount()); |
-} |
- |
// Test that GesturePinchUpdate is handled specially for trackpad |
TEST_F(InputRouterImplTest, TouchpadPinchUpdate) { |
// GesturePinchUpdate for trackpad sends synthetic wheel events. |