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

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

Issue 2782733002: MouseWheelEventQueue sends scrollEnd right away when latching is disabled. (Closed)
Patch Set: review comments addressed. Created 3 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
« no previous file with comments | « no previous file | content/browser/renderer_host/input/mock_input_ack_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 d0e5634de62f1413f986ab26731c366883ed32ab..02d435f1bd627ae6365fce11a2bdd7aac188113f 100644
--- a/content/browser/renderer_host/input/input_router_impl_unittest.cc
+++ b/content/browser/renderer_host/input/input_router_impl_unittest.cc
@@ -1026,19 +1026,41 @@ TEST_F(InputRouterImplTest, UnhandledWheelEvent) {
// were processed.
EXPECT_EQ(2U, ack_handler_->GetAndResetAckCount());
- // There should be a ScrollBegin and ScrollUpdate, MouseWheel sent
+ // There should be a ScrollBegin and ScrollUpdate, MouseWheel sent.
EXPECT_EQ(3U, GetSentMessageCountAndResetSink());
EXPECT_EQ(ack_handler_->acked_wheel_event().deltaY, -5);
SendInputEventACK(WebInputEvent::GestureScrollUpdate,
INPUT_EVENT_ACK_STATE_CONSUMED);
+
+ // The GestureScrollUpdate ACK releases the GestureScrollEnd.
+ EXPECT_EQ(1U, GetSentMessageCountAndResetSink());
+
+ // Check that the ack for the ScrollUpdate and ScrollEnd
+ // were processed.
+ EXPECT_EQ(2U, ack_handler_->GetAndResetAckCount());
+
SendInputEventACK(WebInputEvent::MouseWheel,
INPUT_EVENT_ACK_STATE_NOT_CONSUMED);
+ // There should be a ScrollBegin and ScrollUpdate sent.
+ EXPECT_EQ(2U, GetSentMessageCountAndResetSink());
+
// Check that the correct unhandled wheel event was received.
EXPECT_EQ(2U, ack_handler_->GetAndResetAckCount());
- EXPECT_EQ(INPUT_EVENT_ACK_STATE_NOT_CONSUMED, ack_handler_->ack_state());
+ EXPECT_EQ(INPUT_EVENT_ACK_STATE_NOT_CONSUMED,
+ ack_handler_->acked_wheel_event_state());
EXPECT_EQ(ack_handler_->acked_wheel_event().deltaY, -10);
+
+ SendInputEventACK(WebInputEvent::GestureScrollUpdate,
+ INPUT_EVENT_ACK_STATE_CONSUMED);
+
+ // The GestureScrollUpdate ACK releases the GestureScrollEnd.
+ EXPECT_EQ(1U, GetSentMessageCountAndResetSink());
+
+ // Check that the ack for the ScrollUpdate and ScrollEnd
+ // were processed.
+ EXPECT_EQ(2U, ack_handler_->GetAndResetAckCount());
}
TEST_F(InputRouterImplTest, TouchTypesIgnoringAck) {
« no previous file with comments | « no previous file | content/browser/renderer_host/input/mock_input_ack_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698