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

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

Issue 252753002: Add multifinger swipe event to TouchDispositionGestureFilter. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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/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 eff53420254d0d13ad33048d535c75705a507f8e..728d4b21e400ac0d2e2f05c8ed2d7fa1bd1c7d2e 100644
--- a/ui/events/gesture_detection/touch_disposition_gesture_filter_unittest.cc
+++ b/ui/events/gesture_detection/touch_disposition_gesture_filter_unittest.cc
@@ -938,4 +938,46 @@ TEST_F(TouchDispositionGestureFilterTest, TestCancelMidGesture) {
GetAndResetSentGestures()));
}
+// Test that a MultiFingerSwipe event is dispatched when appropriate.
+TEST_F(TouchDispositionGestureFilterTest, TestAllowedMultiFingerSwipe) {
+ PushGesture(ET_GESTURE_SCROLL_BEGIN);
+ PressTouchPoint(1, 1);
+ SendTouchNotConsumedAck();
+ EXPECT_TRUE(GesturesMatch(Gestures(ET_GESTURE_SCROLL_BEGIN),
+ GetAndResetSentGestures()));
+
+ PushGesture(ET_GESTURE_PINCH_BEGIN);
+ PressTouchPoint(1, 1);
+ SendTouchNotConsumedAck();
+ EXPECT_TRUE(GesturesMatch(Gestures(ET_GESTURE_PINCH_BEGIN),
+ GetAndResetSentGestures()));
+
+ PushGesture(ET_GESTURE_MULTIFINGER_SWIPE);
+ PressTouchPoint(1, 1);
+ SendTouchNotConsumedAck();
+ EXPECT_TRUE(GesturesMatch(Gestures(ET_GESTURE_MULTIFINGER_SWIPE),
+ GetAndResetSentGestures()));
+}
+
+ // Test that a MultiFingerSwipe event is dispatched when appropriate.
+TEST_F(TouchDispositionGestureFilterTest, TestDisallowedMultiFingerSwipe) {
+ PressTouchPoint(1, 1);
+ SendTouchNotConsumedAck();
+
+ PushGesture(ET_GESTURE_SCROLL_BEGIN);
+ MoveTouchPoint(0, 0, 0);
+ SendTouchConsumedAck();
+ EXPECT_FALSE(GesturesSent());
+
+ PushGesture(ET_GESTURE_PINCH_BEGIN);
+ PressTouchPoint(1, 1);
+ SendTouchNotConsumedAck();
+ EXPECT_FALSE(GesturesSent());
+
+ PushGesture(ET_GESTURE_MULTIFINGER_SWIPE);
+ PressTouchPoint(1, 1);
+ SendTouchNotConsumedAck();
+ EXPECT_FALSE(GesturesSent());
+}
+
} // namespace ui

Powered by Google App Engine
This is Rietveld 408576698