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

Unified Diff: ui/events/gesture_detection/touch_disposition_gesture_filter_unittest.cc

Issue 280593003: Send TapCancel when a second finger is pressed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address jdduke's comments. Created 6 years, 7 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/gesture_detection/touch_disposition_gesture_filter.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/gesture_detection/touch_disposition_gesture_filter_unittest.cc
diff --git a/ui/events/gesture_detection/touch_disposition_gesture_filter_unittest.cc b/ui/events/gesture_detection/touch_disposition_gesture_filter_unittest.cc
index 391c66968f7cf642f503a2cc4cb84ff90ff96776..5ca210a07e3c88a5dfea5d1070fd25c0be995575 100644
--- a/ui/events/gesture_detection/touch_disposition_gesture_filter_unittest.cc
+++ b/ui/events/gesture_detection/touch_disposition_gesture_filter_unittest.cc
@@ -711,21 +711,18 @@ TEST_F(TouchDispositionGestureFilterTest,
TapNotCancelledIfTapEndingEventReceived) {
PushGesture(ET_GESTURE_TAP_DOWN);
PressTouchPoint(1, 1);
- PressTouchPoint(2, 2);
- SendTouchNotConsumedAck();
SendTouchNotConsumedAck();
- EXPECT_TRUE(GesturesMatch(Gestures(ET_GESTURE_TAP_DOWN),
- GetAndResetSentGestures()));
+ EXPECT_TRUE(
+ GesturesMatch(Gestures(ET_GESTURE_TAP_DOWN), GetAndResetSentGestures()));
PushGesture(ET_GESTURE_TAP);
ReleaseTouchPoint();
SendTouchNotConsumedAck();
- EXPECT_TRUE(GesturesMatch(Gestures(ET_GESTURE_SHOW_PRESS,
- ET_GESTURE_TAP),
+ EXPECT_TRUE(GesturesMatch(Gestures(ET_GESTURE_SHOW_PRESS, ET_GESTURE_TAP),
GetAndResetSentGestures()));
// The tap should not be cancelled as it was terminated by a |ET_GESTURE_TAP|.
- ReleaseTouchPoint();
+ PressTouchPoint(2, 2);
SendTouchConsumedAck();
EXPECT_FALSE(GesturesSent());
}
@@ -1027,4 +1024,17 @@ TEST_F(TouchDispositionGestureFilterTest, TestDisallowedMultiFingerSwipe) {
EXPECT_FALSE(GesturesSent());
}
+TEST_F(TouchDispositionGestureFilterTest, TapCancelOnSecondFingerDown) {
+ PushGesture(ET_GESTURE_TAP_DOWN);
+ PressTouchPoint(1, 1);
+ SendTouchNotConsumedAck();
+ EXPECT_TRUE(GesturesMatch(Gestures(ET_GESTURE_TAP_DOWN),
+ GetAndResetSentGestures()));
+
+ PressTouchPoint(1, 1);
+ SendTouchNotConsumedAck();
+ EXPECT_TRUE(GesturesMatch(Gestures(ET_GESTURE_TAP_CANCEL),
+ GetAndResetSentGestures()));
+}
+
} // namespace ui
« no previous file with comments | « ui/events/gesture_detection/touch_disposition_gesture_filter.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698