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

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

Issue 78263003: Ignore TouchCancel ack dispositions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Speculative fix... Created 7 years, 1 month 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/immediate_input_router_unittest.cc
diff --git a/content/browser/renderer_host/input/immediate_input_router_unittest.cc b/content/browser/renderer_host/input/immediate_input_router_unittest.cc
index 08adc53755266504cfcbd2239c9309711c0cb0c4..545f0cfeceaa24bcd5f010e2c96b4dd1151e61a1 100644
--- a/content/browser/renderer_host/input/immediate_input_router_unittest.cc
+++ b/content/browser/renderer_host/input/immediate_input_router_unittest.cc
@@ -561,6 +561,33 @@ TEST_F(ImmediateInputRouterTest, UnhandledWheelEvent) {
EXPECT_EQ(ack_handler_->acked_wheel_event().deltaY, -5);
}
+TEST_F(ImmediateInputRouterTest, TouchTypesIgnoringAck) {
+ int start_type = static_cast<int>(WebInputEvent::TouchStart);
+ int end_type = static_cast<int>(WebInputEvent::TouchCancel);
+ for (int i = start_type; i <= end_type; ++i) {
+ WebInputEvent::Type type = static_cast<WebInputEvent::Type>(i);
+ if (!WebInputEventTraits::IgnoresAckDisposition(type))
+ continue;
+
+ // The TouchEventQueue requires an initial TouchStart for it to begin
+ // forwarding other touch event types.
+ if (type != WebInputEvent::TouchStart) {
+ SimulateTouchEvent(WebInputEvent::TouchStart);
+ SendInputEventACK(WebInputEvent::TouchStart,
+ INPUT_EVENT_ACK_STATE_CONSUMED);
+ ASSERT_EQ(1U, GetSentMessageCountAndResetSink());
+ ASSERT_EQ(1U, ack_handler_->GetAndResetAckCount());
+ }
+
+ SimulateTouchEvent(type);
+ EXPECT_EQ(1U, GetSentMessageCountAndResetSink());
+ EXPECT_EQ(1U, ack_handler_->GetAndResetAckCount());
+ SendInputEventACK(type, INPUT_EVENT_ACK_STATE_NOT_CONSUMED);
+ EXPECT_EQ(0U, GetSentMessageCountAndResetSink());
+ EXPECT_EQ(0U, ack_handler_->GetAndResetAckCount());
+ }
+}
+
TEST_F(ImmediateInputRouterTest, GestureTypesIgnoringAck) {
int start_type = static_cast<int>(WebInputEvent::GestureScrollBegin);
int end_type = static_cast<int>(WebInputEvent::GesturePinchUpdate);

Powered by Google App Engine
This is Rietveld 408576698