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

Unified Diff: ui/aura/gestures/gesture_recognizer_unittest.cc

Issue 680413006: Re-enable Eager Gesture Recognition on Aura (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix windows. Created 6 years, 1 month 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/aura/gestures/gesture_recognizer_unittest.cc
diff --git a/ui/aura/gestures/gesture_recognizer_unittest.cc b/ui/aura/gestures/gesture_recognizer_unittest.cc
index 3d83def43976d8b9aab4de68b15845118a35f936..e8a9f9d3eb690d2d49e739a1b163ccfda777614f 100644
--- a/ui/aura/gestures/gesture_recognizer_unittest.cc
+++ b/ui/aura/gestures/gesture_recognizer_unittest.cc
@@ -349,7 +349,7 @@ class QueueTouchEventDelegate : public GestureEventConsumeDelegate {
void OnTouchEvent(ui::TouchEvent* event) override {
if (queue_events_) {
queue_.push(new ui::TouchEvent(*event, window_, window_));
- event->StopPropagation();
+ event->DisableSynchronousHandling();
}
}
@@ -4247,7 +4247,7 @@ TEST_F(GestureRecognizerTest, GestureEventSmallPinchEnabled) {
// Tests that delaying the ack of a touch release doesn't trigger a long press
// gesture.
-TEST_F(GestureRecognizerTest, DISABLED_EagerGestureDetection) {
+TEST_F(GestureRecognizerTest, EagerGestureDetection) {
scoped_ptr<QueueTouchEventDelegate> delegate(
new QueueTouchEventDelegate(host()->dispatcher()));
TimedEvents tes;
@@ -4280,9 +4280,9 @@ TEST_F(GestureRecognizerTest, DISABLED_EagerGestureDetection) {
EXPECT_FALSE(delegate->long_press());
}
-// This tests crbug.com/405519, in which events which the gesture detector
-// ignores cause future events to also be thrown away.
-TEST_F(GestureRecognizerTest, IgnoredEventsDontPreventFutureEvents) {
+// This tests crbug.com/405519, in which touch events which the gesture detector
+// ignores interfere with gesture recognition.
+TEST_F(GestureRecognizerTest, IgnoredEventsDontBreakGestureRecognition) {
scoped_ptr<QueueTouchEventDelegate> delegate(
new QueueTouchEventDelegate(host()->dispatcher()));
TimedEvents tes;
@@ -4315,9 +4315,12 @@ TEST_F(GestureRecognizerTest, IgnoredEventsDontPreventFutureEvents) {
ui::ET_GESTURE_SCROLL_UPDATE);
delegate->Reset();
+
+ // Send a valid event, but don't ack it.
ui::TouchEvent move2(
ui::ET_TOUCH_MOVED, gfx::Point(65, 202), kTouchId1, tes.Now());
DispatchEventUsingWindowDispatcher(&move2);
+ EXPECT_0_EVENTS(delegate->events());
// Send a touchmove event at the same location as the previous touchmove
// event. This shouldn't do anything.
@@ -4325,6 +4328,8 @@ TEST_F(GestureRecognizerTest, IgnoredEventsDontPreventFutureEvents) {
ui::ET_TOUCH_MOVED, gfx::Point(65, 202), kTouchId1, tes.Now());
DispatchEventUsingWindowDispatcher(&move3);
+ // Ack the previous valid event. The intermediary invalid event shouldn't
+ // interfere.
delegate->ReceivedAck();
EXPECT_1_EVENT(delegate->events(), ui::ET_GESTURE_SCROLL_UPDATE);
}

Powered by Google App Engine
This is Rietveld 408576698