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

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: REbase 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
« no previous file with comments | « no previous file | content/browser/renderer_host/input/input_router_unittest.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..dfd1ee026b80cbab166ac975b9cd21eb00bd3d89 100644
--- a/content/browser/renderer_host/input/immediate_input_router_unittest.cc
+++ b/content/browser/renderer_host/input/immediate_input_router_unittest.cc
@@ -561,19 +561,47 @@ 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);
for (int i = start_type; i <= end_type; ++i) {
WebInputEvent::Type type = static_cast<WebInputEvent::Type>(i);
- if (WebInputEventTraits::IgnoresAckDisposition(type)) {
- SimulateGestureEvent(type, WebGestureEvent::Touchscreen);
- 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());
- }
+ if (!WebInputEventTraits::IgnoresAckDisposition(type))
+ continue;
+
+ SimulateGestureEvent(type, WebGestureEvent::Touchscreen);
+ 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());
}
}
« no previous file with comments | « no previous file | content/browser/renderer_host/input/input_router_unittest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698