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

Unified Diff: content/common/input/event_with_latency_info_unittest.cc

Issue 2257023004: Coalesced mouse wheel event has the position of the most recent event. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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/common/input/event_with_latency_info_unittest.cc
diff --git a/content/common/input/event_with_latency_info_unittest.cc b/content/common/input/event_with_latency_info_unittest.cc
index 45907f7117b11d39e2b7bb7b1b33b9d729671047..b7f6d5cddd6e2209a3b13f148882e7258ed764bd 100644
--- a/content/common/input/event_with_latency_info_unittest.cc
+++ b/content/common/input/event_with_latency_info_unittest.cc
@@ -313,6 +313,18 @@ TEST_F(EventWithLatencyInfoTest, WebMouseWheelEventCoalescing) {
mouse_wheel_0.event.modifiers = WebInputEvent::ControlKey;
mouse_wheel_1.event.modifiers = WebInputEvent::ShiftKey;
EXPECT_FALSE(CanCoalesce(mouse_wheel_0, mouse_wheel_1));
+
+ // Coalesced event has the position of the most recent event.
+ mouse_wheel_0 = CreateMouseWheel(1, 1);
+ mouse_wheel_0.event.x = 1;
+ mouse_wheel_0.event.y = 1;
+ mouse_wheel_1 = CreateMouseWheel(2, 2);
+ mouse_wheel_1.event.x = 2;
+ mouse_wheel_1.event.y = 2;
+ EXPECT_TRUE(CanCoalesce(mouse_wheel_0, mouse_wheel_1));
+ Coalesce(mouse_wheel_0, &mouse_wheel_1);
dtapuska 2016/08/19 01:41:41 Ultimately this coalescing test could probably be
tdresser 2016/08/19 12:43:30 The naming here is a bit confusing. We might want
sahel 2016/08/19 15:17:56 Done.
sahel 2016/08/19 15:17:57 Then naming is consistent with the rest of the uni
+ EXPECT_EQ(1, mouse_wheel_1.event.x);
+ EXPECT_EQ(1, mouse_wheel_1.event.y);
}
// Coalescing preserves the newer timestamp.

Powered by Google App Engine
This is Rietveld 408576698