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

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

Issue 549333002: Always send the ET_GESTURE_END event as the last one for every touch event. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add cast to index Created 6 years, 3 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 cfe02da4db39d57952e744a7b1c9ea798591c7c6..07cfb1754a3e4b09c9ab6c637faa504e9b883d95 100644
--- a/ui/events/gesture_detection/touch_disposition_gesture_filter_unittest.cc
+++ b/ui/events/gesture_detection/touch_disposition_gesture_filter_unittest.cc
@@ -988,7 +988,7 @@ TEST_F(TouchDispositionGestureFilterTest,
PushGesture(ET_GESTURE_END);
ReleaseTouchPoint();
SendTouchNotConsumedAck();
- EXPECT_TRUE(GesturesMatch(Gestures(ET_GESTURE_END, ET_GESTURE_SCROLL_END),
+ EXPECT_TRUE(GesturesMatch(Gestures(ET_GESTURE_SCROLL_END, ET_GESTURE_END),
GetAndResetSentGestures()));
EXPECT_EQ(LastSentGestureLocation(), gfx::PointF(2, 2));
@@ -1101,4 +1101,25 @@ TEST_F(TouchDispositionGestureFilterTest, ShowPressBoundingBox) {
EXPECT_EQ(gfx::RectF(5, 5, 10, 10), ShowPressBoundingBox());
}
+TEST_F(TouchDispositionGestureFilterTest, TapCancelledBeforeGestureEnd) {
+ PushGesture(ET_GESTURE_BEGIN);
+ PushGesture(ET_GESTURE_TAP_DOWN);
+ PressTouchPoint(1, 1);
+ SendTouchNotConsumedAck();
+ EXPECT_TRUE(GesturesMatch(Gestures(ET_GESTURE_BEGIN, ET_GESTURE_TAP_DOWN),
+ GetAndResetSentGestures()));
+ SendTimeoutGesture(ET_GESTURE_SHOW_PRESS);
+ EXPECT_TRUE(GesturesMatch(Gestures(ET_GESTURE_SHOW_PRESS),
+ GetAndResetSentGestures()));
+
+ SendTimeoutGesture(ET_GESTURE_LONG_PRESS);
+ EXPECT_TRUE(GesturesMatch(Gestures(ET_GESTURE_LONG_PRESS),
+ GetAndResetSentGestures()));
+ PushGesture(ET_GESTURE_END);
+ CancelTouchPoint();
+ SendTouchNotConsumedAck();
+ EXPECT_TRUE(GesturesMatch(Gestures(ET_GESTURE_TAP_CANCEL, ET_GESTURE_END),
+ 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