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

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: Added a few checks. 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 e5d16cba8a259c40ff3f0788e5459dbb2e49b3e2..d33bb8ecf289bd0d6ff652a784f81998bb97c629 100644
--- a/content/browser/renderer_host/input/input_router_impl_unittest.cc
+++ b/content/browser/renderer_host/input/input_router_impl_unittest.cc
@@ -276,6 +276,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);
}
@@ -1101,6 +1111,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());
}
}
@@ -1231,7 +1246,6 @@ TEST_F(InputRouterImplTest, GestureShowPressIsInOrder) {
EXPECT_EQ(1U, GetSentMessageCountAndResetSink());
EXPECT_EQ(1U, ack_handler_->GetAndResetAckCount());
-
// GesturePinchBegin ignores its ack.
SimulateGestureEvent(WebInputEvent::GesturePinchBegin,
blink::WebGestureDeviceTouchscreen);
@@ -1450,6 +1464,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
@@ -1690,6 +1705,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.
@@ -1699,6 +1715,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());
@@ -1726,6 +1744,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