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

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

Issue 873283003: Invalid press events don't create multiple pointers with the same id. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update test. Created 5 years, 11 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 | « ui/events/gestures/motion_event_aura.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 57ee6ce256999471efc89fc6c0fab2af985f0010..8decac0bc198a35eecc5416fb5f5d6533cc24019 100644
--- a/ui/events/gestures/motion_event_aura_unittest.cc
+++ b/ui/events/gestures/motion_event_aura_unittest.cc
@@ -456,10 +456,20 @@ TEST(MotionEventAuraTest, Flags) {
// Once crbug.com/446852 is fixed, we should ignore redundant presses.
TEST(MotionEventAuraTest, DoesntIgnoreRedundantPresses) {
- int id = 7;
+ const int id = 7;
+ const int position_1 = 10;
+ const int position_2 = 23;
+
MotionEventAura event;
- EXPECT_TRUE(event.OnTouch(TouchWithType(ET_TOUCH_PRESSED, id)));
- EXPECT_TRUE(event.OnTouch(TouchWithType(ET_TOUCH_PRESSED, id)));
+ TouchEvent press1 = TouchWithPosition(ET_TOUCH_PRESSED, id, position_1,
+ position_1, position_1, position_1);
+ EXPECT_TRUE(event.OnTouch(press1));
+ TouchEvent press2 = TouchWithPosition(ET_TOUCH_PRESSED, id, position_2,
+ position_2, position_2, position_2);
+ EXPECT_TRUE(event.OnTouch(press2));
+
+ EXPECT_EQ(1U, event.GetPointerCount());
+ EXPECT_FLOAT_EQ(position_2, event.GetX(0));
}
TEST(MotionEventAuraTest, IgnoresEventsWithoutPress) {
« no previous file with comments | « ui/events/gestures/motion_event_aura.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698