| 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 d8a8d10eb17130ba2e109214b7efe8b1f0cd8ec0..872fdede73b3a46f0bbaded3c096556a68cd98fc 100644
|
| --- a/ui/aura/gestures/gesture_recognizer_unittest.cc
|
| +++ b/ui/aura/gestures/gesture_recognizer_unittest.cc
|
| @@ -2099,7 +2099,8 @@ scoped_ptr<GestureEventConsumeDelegate> delegate(
|
| }
|
|
|
| TEST_P(GestureRecognizerTest, GestureEventPinchFromTap) {
|
| - // TODO(tdresser): enable this test with unified GR once two finger tap.
|
| + // Disabled under unified gesture recognizer due to behavior differences in
|
| + // scroll and bounding box behavior.
|
| if (UsingUnifiedGR())
|
| return;
|
|
|
| @@ -3147,10 +3148,16 @@ TEST_P(GestureRecognizerTest, GestureEventScrollTouchMoveConsumed) {
|
| EXPECT_FALSE(delegate->tap_down());
|
| EXPECT_TRUE(delegate->tap_cancel());
|
| EXPECT_FALSE(delegate->begin());
|
| - EXPECT_FALSE(delegate->scroll_begin());
|
| EXPECT_FALSE(delegate->scroll_update());
|
| EXPECT_FALSE(delegate->scroll_end());
|
|
|
| + // With the unified gesture detector, consuming the first touch move event
|
| + // won't prevent all future scrolling.
|
| + if (UsingUnifiedGR())
|
| + EXPECT_TRUE(delegate->scroll_begin());
|
| + else
|
| + EXPECT_FALSE(delegate->scroll_begin());
|
| +
|
| // Release the touch back at the start point. This should end without causing
|
| // a tap.
|
| delegate->Reset();
|
| @@ -3164,7 +3171,11 @@ TEST_P(GestureRecognizerTest, GestureEventScrollTouchMoveConsumed) {
|
| EXPECT_TRUE(delegate->end());
|
| EXPECT_FALSE(delegate->scroll_begin());
|
| EXPECT_FALSE(delegate->scroll_update());
|
| - EXPECT_FALSE(delegate->scroll_end());
|
| +
|
| + if (UsingUnifiedGR())
|
| + EXPECT_TRUE(delegate->scroll_end());
|
| + else
|
| + EXPECT_FALSE(delegate->scroll_end());
|
| }
|
|
|
| // Tests the behavior of 2F scroll when all the touch-move events are consumed.
|
| @@ -3311,10 +3322,16 @@ TEST_P(GestureRecognizerTest, GestureEventScrollTouchMovePartialConsumed) {
|
| EXPECT_FALSE(delegate->tap_down());
|
| EXPECT_TRUE(delegate->tap_cancel());
|
| EXPECT_FALSE(delegate->begin());
|
| - EXPECT_FALSE(delegate->scroll_begin());
|
| EXPECT_FALSE(delegate->scroll_update());
|
| EXPECT_FALSE(delegate->scroll_end());
|
|
|
| + // With the unified gesture detector, consuming the first touch move event
|
| + // won't prevent all future scrolling.
|
| + if (UsingUnifiedGR())
|
| + EXPECT_TRUE(delegate->scroll_begin());
|
| + else
|
| + EXPECT_FALSE(delegate->scroll_begin());
|
| +
|
| // Now, stop consuming touch-move events, and move the touch-point again.
|
| delegate->set_consume_touch_move(false);
|
| tes.SendScrollEvent(event_processor(), 159, 259, kTouchId, delegate.get());
|
| @@ -3323,13 +3340,23 @@ TEST_P(GestureRecognizerTest, GestureEventScrollTouchMovePartialConsumed) {
|
| EXPECT_FALSE(delegate->tap_cancel());
|
| EXPECT_FALSE(delegate->begin());
|
| EXPECT_FALSE(delegate->scroll_begin());
|
| - EXPECT_FALSE(delegate->scroll_update());
|
| EXPECT_FALSE(delegate->scroll_end());
|
| - // No scroll has occurred, because an early touch move was consumed.
|
| - EXPECT_EQ(0, delegate->scroll_x());
|
| - EXPECT_EQ(0, delegate->scroll_y());
|
| - EXPECT_EQ(gfx::Point(0, 0).ToString(),
|
| - delegate->scroll_begin_position().ToString());
|
| +
|
| + if (UsingUnifiedGR()) {
|
| + // Scroll not prevented by consumed first touch move.
|
| + EXPECT_TRUE(delegate->scroll_update());
|
| + EXPECT_EQ(29, delegate->scroll_x());
|
| + EXPECT_EQ(29, delegate->scroll_y());
|
| + EXPECT_EQ(gfx::Point(0, 0).ToString(),
|
| + delegate->scroll_begin_position().ToString());
|
| + } else {
|
| + EXPECT_FALSE(delegate->scroll_update());
|
| + // No scroll has occurred, because an early touch move was consumed.
|
| + EXPECT_EQ(0, delegate->scroll_x());
|
| + EXPECT_EQ(0, delegate->scroll_y());
|
| + EXPECT_EQ(gfx::Point(0, 0).ToString(),
|
| + delegate->scroll_begin_position().ToString());
|
| + }
|
|
|
| // Start consuming touch-move events again.
|
| delegate->set_consume_touch_move(true);
|
| @@ -3369,8 +3396,12 @@ TEST_P(GestureRecognizerTest, GestureEventScrollTouchMovePartialConsumed) {
|
| EXPECT_TRUE(delegate->end());
|
| EXPECT_FALSE(delegate->scroll_begin());
|
| EXPECT_FALSE(delegate->scroll_update());
|
| - EXPECT_FALSE(delegate->scroll_end());
|
| EXPECT_FALSE(delegate->fling());
|
| +
|
| + if (UsingUnifiedGR())
|
| + EXPECT_TRUE(delegate->scroll_end());
|
| + else
|
| + EXPECT_FALSE(delegate->scroll_end());
|
| }
|
|
|
| // Check that appropriate touch events generate double tap gesture events.
|
| @@ -3708,14 +3739,15 @@ TEST_P(GestureRecognizerTest, GestureEventConsumedTouchMoveCanFireTapCancel) {
|
| delegate->set_consume_touch_move(true);
|
| delegate->Reset();
|
| // Move the touch-point enough so that it would normally be considered a
|
| - // scroll. But since the touch-moves will be consumed, the scroll should not
|
| - // start.
|
| + // scroll. But since the touch-moves will be consumed, no scrolling should
|
| + // occur.
|
| + // With the unified gesture detector, we will receive a scroll begin gesture,
|
| + // whereas with the aura gesture recognizer we won't.
|
| tes.SendScrollEvent(event_processor(), 130, 230, kTouchId, delegate.get());
|
| EXPECT_FALSE(delegate->tap());
|
| EXPECT_FALSE(delegate->tap_down());
|
| EXPECT_TRUE(delegate->tap_cancel());
|
| EXPECT_FALSE(delegate->begin());
|
| - EXPECT_FALSE(delegate->scroll_begin());
|
| EXPECT_FALSE(delegate->scroll_update());
|
| EXPECT_FALSE(delegate->scroll_end());
|
| }
|
| @@ -3914,8 +3946,15 @@ TEST_P(GestureRecognizerTest, GestureEventConsumedTouchMoveScrollTest) {
|
| DispatchEventUsingWindowDispatcher(&move2);
|
| delegate->ReceivedAck();
|
|
|
| - EXPECT_FALSE(delegate->scroll_begin());
|
| - EXPECT_FALSE(delegate->scroll_update());
|
| + if (UsingUnifiedGR()) {
|
| + // With the unified gesture detector, consuming the first touch move event
|
| + // won't prevent all future scrolling.
|
| + EXPECT_TRUE(delegate->scroll_begin());
|
| + EXPECT_TRUE(delegate->scroll_update());
|
| + } else {
|
| + EXPECT_FALSE(delegate->scroll_begin());
|
| + EXPECT_FALSE(delegate->scroll_update());
|
| + }
|
| }
|
|
|
| // Test that consuming the first touch move event of a touch point doesn't
|
|
|