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

Unified Diff: content/renderer/input/input_event_filter_unittest.cc

Issue 2094323002: Ensure acks are sent for all blocking events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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/renderer/input/input_event_filter_unittest.cc
diff --git a/content/renderer/input/input_event_filter_unittest.cc b/content/renderer/input/input_event_filter_unittest.cc
index f79e69d2d9b2a9fa14168d868f0493b0b90b9b11..39547e27514d5be83de66c89ffe148609032ae96 100644
--- a/content/renderer/input/input_event_filter_unittest.cc
+++ b/content/renderer/input/input_event_filter_unittest.cc
@@ -330,19 +330,22 @@ TEST_F(InputEventFilterTest, NonBlockingWheel) {
EXPECT_EQ(1u, message_recorder_.message_count());
// Second event was queued; ack the first.
- filter_->NotifyInputEventHandled(kTestRoutingID, WebInputEvent::MouseWheel);
+ filter_->NotifyInputEventHandled(kTestRoutingID, WebInputEvent::MouseWheel,
+ INPUT_EVENT_ACK_STATE_CONSUMED);
base::RunLoop().RunUntilIdle();
ASSERT_EQ(4u, ipc_sink_.message_count());
EXPECT_EQ(2u, message_recorder_.message_count());
// Third event won't be coalesced into the second because modifiers are
// different.
- filter_->NotifyInputEventHandled(kTestRoutingID, WebInputEvent::MouseWheel);
+ filter_->NotifyInputEventHandled(kTestRoutingID, WebInputEvent::MouseWheel,
+ INPUT_EVENT_ACK_STATE_CONSUMED);
base::RunLoop().RunUntilIdle();
EXPECT_EQ(3u, message_recorder_.message_count());
// The last events will be coalesced.
- filter_->NotifyInputEventHandled(kTestRoutingID, WebInputEvent::MouseWheel);
+ filter_->NotifyInputEventHandled(kTestRoutingID, WebInputEvent::MouseWheel,
+ INPUT_EVENT_ACK_STATE_CONSUMED);
base::RunLoop().RunUntilIdle();
EXPECT_EQ(3u, message_recorder_.message_count());
@@ -408,19 +411,22 @@ TEST_F(InputEventFilterTest, NonBlockingTouch) {
EXPECT_EQ(1u, message_recorder_.message_count());
// Second event was queued; ack the first.
- filter_->NotifyInputEventHandled(kTestRoutingID, WebInputEvent::TouchStart);
+ filter_->NotifyInputEventHandled(kTestRoutingID, WebInputEvent::TouchStart,
+ INPUT_EVENT_ACK_STATE_CONSUMED);
base::RunLoop().RunUntilIdle();
ASSERT_EQ(4u, ipc_sink_.message_count());
EXPECT_EQ(2u, message_recorder_.message_count());
// Third event won't be coalesced into the second because modifiers are
// different.
- filter_->NotifyInputEventHandled(kTestRoutingID, WebInputEvent::TouchMove);
+ filter_->NotifyInputEventHandled(kTestRoutingID, WebInputEvent::TouchMove,
+ INPUT_EVENT_ACK_STATE_CONSUMED);
base::RunLoop().RunUntilIdle();
EXPECT_EQ(3u, message_recorder_.message_count());
// The last events will be coalesced.
- filter_->NotifyInputEventHandled(kTestRoutingID, WebInputEvent::TouchMove);
+ filter_->NotifyInputEventHandled(kTestRoutingID, WebInputEvent::TouchMove,
+ INPUT_EVENT_ACK_STATE_CONSUMED);
base::RunLoop().RunUntilIdle();
EXPECT_EQ(3u, message_recorder_.message_count());
@@ -503,7 +509,8 @@ TEST_F(InputEventFilterTest, IntermingledNonBlockingTouch) {
{
// Second event was queued; ack the first.
- filter_->NotifyInputEventHandled(kTestRoutingID, WebInputEvent::TouchStart);
+ filter_->NotifyInputEventHandled(kTestRoutingID, WebInputEvent::TouchStart,
+ INPUT_EVENT_ACK_STATE_CONSUMED);
base::RunLoop().RunUntilIdle();
EXPECT_EQ(2u, message_recorder_.message_count());
@@ -524,7 +531,8 @@ TEST_F(InputEventFilterTest, IntermingledNonBlockingTouch) {
{
// Third event should be put in the queue.
- filter_->NotifyInputEventHandled(kTestRoutingID, WebInputEvent::TouchEnd);
+ filter_->NotifyInputEventHandled(kTestRoutingID, WebInputEvent::TouchEnd,
+ INPUT_EVENT_ACK_STATE_CONSUMED);
base::RunLoop().RunUntilIdle();
EXPECT_EQ(3u, message_recorder_.message_count());

Powered by Google App Engine
This is Rietveld 408576698