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

Unified Diff: content/browser/renderer_host/input/input_router_impl_unittest.cc

Issue 1800143002: Notify Blink about start of gesture scroll through a queued event. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Ignored ack mismatch. Created 4 years, 8 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
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 861ecaeefa8004ed06933875779aff2598ec5a36..64e4094c0cf4c9b410e8a1a4cdd8eece3837f6ee 100644
--- a/content/browser/renderer_host/input/input_router_impl_unittest.cc
+++ b/content/browser/renderer_host/input/input_router_impl_unittest.cc
@@ -274,6 +274,16 @@ class InputRouterImplTest : public testing::Test {
return touch_event_id;
}
+ // The TouchScrollStarted event doesn't need an ack from downstream, and is
+ // acked from within the TouchEventQueue to trigger its dequeuing. For this
+ // test, we send an artificial ack to get the same result.
+ void AckTouchScrollStartedNotification() {
+ ui::LatencyInfo latency_info;
+ input_router_->ProcessInputEventAck(
+ WebInputEvent::TouchScrollStarted, INPUT_EVENT_ACK_STATE_IGNORED,
+ latency_info, 0, InputRouterImpl::IGNORING_DISPOSITION);
+ }
+
int PressTouchPoint(int x, int y) {
return touch_event_.PressPoint(x, y);
}
@@ -1103,6 +1113,11 @@ TEST_F(InputRouterImplTest, GestureTypesIgnoringAck) {
EXPECT_EQ(1U, GetSentMessageCountAndResetSink());
EXPECT_EQ(1U, ack_handler_->GetAndResetAckCount());
EXPECT_EQ(0, client_->in_flight_event_count());
+
+ if (type == WebInputEvent::GestureScrollBegin) {
+ EXPECT_TRUE(HasPendingEvents());
+ AckTouchScrollStartedNotification();
+ }
EXPECT_FALSE(HasPendingEvents());
}
}
@@ -1233,7 +1248,6 @@ TEST_F(InputRouterImplTest, GestureShowPressIsInOrder) {
EXPECT_EQ(1U, GetSentMessageCountAndResetSink());
EXPECT_EQ(1U, ack_handler_->GetAndResetAckCount());
-
// GesturePinchBegin ignores its ack.
SimulateGestureEvent(WebInputEvent::GesturePinchBegin,
blink::WebGestureDeviceTouchscreen);
@@ -1452,6 +1466,7 @@ TEST_F(InputRouterImplTest, TouchActionResetBeforeEventReachesRenderer) {
EXPECT_EQ(1U, GetSentMessageCountAndResetSink());
SendTouchEventACK(WebInputEvent::TouchEnd, INPUT_EVENT_ACK_STATE_CONSUMED,
touch_release_event_id2);
+ AckTouchScrollStartedNotification();
}
// Test that TouchActionFilter::ResetTouchAction is called when a new touch
@@ -1692,6 +1707,7 @@ TEST_F(InputRouterImplTest, InputFlushAfterFling) {
blink::WebGestureDeviceTouchscreen);
SimulateGestureEvent(WebInputEvent::GestureFlingStart,
blink::WebGestureDeviceTouchscreen);
+ AckTouchScrollStartedNotification();
EXPECT_TRUE(HasPendingEvents());
// If the fling is unconsumed, the flush is complete.
@@ -1701,6 +1717,8 @@ TEST_F(InputRouterImplTest, InputFlushAfterFling) {
blink::WebGestureDeviceTouchscreen);
SendInputEventACK(WebInputEvent::GestureFlingStart,
INPUT_EVENT_ACK_STATE_NOT_CONSUMED);
+ EXPECT_TRUE(HasPendingEvents());
+ AckTouchScrollStartedNotification();
EXPECT_FALSE(HasPendingEvents());
EXPECT_EQ(1U, GetAndResetDidFlushCount());
@@ -1728,6 +1746,7 @@ TEST_F(InputRouterImplTest, InputFlushAfterFling) {
blink::WebGestureDeviceTouchscreen);
SimulateGestureEvent(WebInputEvent::GestureFlingStart,
blink::WebGestureDeviceTouchscreen);
+ AckTouchScrollStartedNotification();
ASSERT_TRUE(HasPendingEvents());
RequestNotificationWhenFlushed();
EXPECT_EQ(0U, GetAndResetDidFlushCount());

Powered by Google App Engine
This is Rietveld 408576698