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

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: Fixed touch_event_stream_validator Created 4 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
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..aa91bd951c7d78a88feeebce4ea04c7564b2208e 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,12 @@ class InputRouterImplTest : public testing::Test {
return touch_event_id;
}
+ void ProcessSyntheticInputEventAck(WebInputEvent::Type type) {
tdresser 2016/04/01 14:50:24 Let's make this method more specific - something l
mustaq 2016/04/01 18:31:04 Done.
+ ui::LatencyInfo latency_info;
+ input_router_->ProcessInputEventAck(type, 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 +1109,9 @@ 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)
+ ProcessSyntheticInputEventAck(WebInputEvent::TouchScrollStarted);
EXPECT_FALSE(HasPendingEvents());
}
}
@@ -1233,7 +1242,6 @@ TEST_F(InputRouterImplTest, GestureShowPressIsInOrder) {
EXPECT_EQ(1U, GetSentMessageCountAndResetSink());
EXPECT_EQ(1U, ack_handler_->GetAndResetAckCount());
-
// GesturePinchBegin ignores its ack.
SimulateGestureEvent(WebInputEvent::GesturePinchBegin,
blink::WebGestureDeviceTouchscreen);
@@ -1692,6 +1700,7 @@ TEST_F(InputRouterImplTest, InputFlushAfterFling) {
blink::WebGestureDeviceTouchscreen);
SimulateGestureEvent(WebInputEvent::GestureFlingStart,
blink::WebGestureDeviceTouchscreen);
+ ProcessSyntheticInputEventAck(WebInputEvent::TouchScrollStarted);
tdresser 2016/04/01 14:50:24 Shouldn't we assert somewhere that we output Touch
mustaq 2016/04/01 18:31:04 The existing tests here only care about events pas
EXPECT_TRUE(HasPendingEvents());
// If the fling is unconsumed, the flush is complete.
@@ -1701,7 +1710,9 @@ TEST_F(InputRouterImplTest, InputFlushAfterFling) {
blink::WebGestureDeviceTouchscreen);
SendInputEventACK(WebInputEvent::GestureFlingStart,
INPUT_EVENT_ACK_STATE_NOT_CONSUMED);
+ ProcessSyntheticInputEventAck(WebInputEvent::TouchScrollStarted);
EXPECT_FALSE(HasPendingEvents());
+
EXPECT_EQ(1U, GetAndResetDidFlushCount());
// Simulate a second fling.
@@ -1728,6 +1739,7 @@ TEST_F(InputRouterImplTest, InputFlushAfterFling) {
blink::WebGestureDeviceTouchscreen);
SimulateGestureEvent(WebInputEvent::GestureFlingStart,
blink::WebGestureDeviceTouchscreen);
+ ProcessSyntheticInputEventAck(WebInputEvent::TouchScrollStarted);
ASSERT_TRUE(HasPendingEvents());
RequestNotificationWhenFlushed();
EXPECT_EQ(0U, GetAndResetDidFlushCount());

Powered by Google App Engine
This is Rietveld 408576698