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

Unified Diff: ui/events/gestures/motion_event_aura_unittest.cc

Issue 999423003: Set the unique_event_id when converting from TouchEvent to WebTouchEvent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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: ui/events/gestures/motion_event_aura_unittest.cc
diff --git a/ui/events/gestures/motion_event_aura_unittest.cc b/ui/events/gestures/motion_event_aura_unittest.cc
index 8decac0bc198a35eecc5416fb5f5d6533cc24019..7b3bcdf2305722d7f753c74cb748db7a155ac4c8 100644
--- a/ui/events/gestures/motion_event_aura_unittest.cc
+++ b/ui/events/gestures/motion_event_aura_unittest.cc
@@ -490,4 +490,22 @@ TEST(MotionEventAuraTest, IgnoresStationaryMoves) {
EXPECT_FALSE(event.OnTouch(move1));
}
+// Test after converting touch events into motion events, motion events should
+// have the same unique_event_id as touch events.
+TEST(MotionEventAuraTest, UniqueEventID) {
+ MotionEventAura event;
+
+ TouchEvent press0 = TouchWithType(ET_TOUCH_PRESSED, 3);
+ EXPECT_TRUE(event.OnTouch(press0));
+ EXPECT_EQ(MotionEvent::ACTION_DOWN, event.GetAction());
+ ASSERT_EQ(1U, event.GetPointerCount());
+ EXPECT_EQ(event.GetUniqueEventId(), press0.unique_event_id());
+
+ TouchEvent press1 = TouchWithType(ET_TOUCH_PRESSED, 6);
+ EXPECT_TRUE(event.OnTouch(press1));
+ EXPECT_EQ(MotionEvent::ACTION_POINTER_DOWN, event.GetAction());
+ EXPECT_EQ(2U, event.GetPointerCount());
+ EXPECT_EQ(event.GetUniqueEventId(), press1.unique_event_id());
+}
+
} // namespace ui

Powered by Google App Engine
This is Rietveld 408576698