summaryrefslogtreecommitdiffstats
path: root/ui/aura/gestures/gesture_recognizer_unittest.cc
diff options
context:
space:
mode:
authorsadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-06 22:04:53 +0000
committersadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-06 22:04:53 +0000
commit756767450156ac5de94caaa9c92ac54c4dd7fdb7 (patch)
treea6f7075b5c8517809cc704cf725b6f8d5ba2b202 /ui/aura/gestures/gesture_recognizer_unittest.cc
parentd234ae91df0bcb27257f506bd612dc85ff45eced (diff)
downloadchromium_src-756767450156ac5de94caaa9c92ac54c4dd7fdb7.zip
chromium_src-756767450156ac5de94caaa9c92ac54c4dd7fdb7.tar.gz
chromium_src-756767450156ac5de94caaa9c92ac54c4dd7fdb7.tar.bz2
aura-x11: Make sure the touch event with the native event gets dispatched.
BUG=none Review URL: https://codereview.chromium.org/12211048 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@181062 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/aura/gestures/gesture_recognizer_unittest.cc')
-rw-r--r--ui/aura/gestures/gesture_recognizer_unittest.cc52
1 files changed, 30 insertions, 22 deletions
diff --git a/ui/aura/gestures/gesture_recognizer_unittest.cc b/ui/aura/gestures/gesture_recognizer_unittest.cc
index 433fb93..48ede7a 100644
--- a/ui/aura/gestures/gesture_recognizer_unittest.cc
+++ b/ui/aura/gestures/gesture_recognizer_unittest.cc
@@ -2074,34 +2074,42 @@ TEST_F(GestureRecognizerTest, PinchScrollWithPreventDefaultedRelease) {
delegate.get(), -1234, bounds, root_window()));
delegate->set_window(window.get());
- delegate->Reset();
+ {
+ delegate->Reset();
+ ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(15, 25), kTouchId1,
+ tes.Now());
+ ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(20, 95), kTouchId1,
+ tes.LeapForward(200));
+ ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(15, 25), kTouchId1,
+ tes.LeapForward(50));
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release);
+ delegate->Reset();
+
+ // Ack the press event.
+ delegate->ReceivedAck();
+ EXPECT_TRUE(delegate->tap_down());
+ delegate->Reset();
+
+ // Ack the move event.
+ delegate->ReceivedAck();
+ EXPECT_TRUE(delegate->tap_cancel());
+ EXPECT_TRUE(delegate->scroll_begin());
+ delegate->Reset();
+
+ // Ack the release event. Although the release event has been processed, it
+ // should still generate a scroll-end event.
+ delegate->ReceivedAckPreventDefaulted();
+ EXPECT_TRUE(delegate->scroll_end());
+ }
+
ui::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(15, 25), kTouchId1,
tes.Now());
ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(20, 95), kTouchId1,
tes.LeapForward(200));
ui::TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(15, 25), kTouchId1,
tes.LeapForward(50));
- root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press);
- root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move);
- root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release);
- delegate->Reset();
-
- // Ack the press event.
- delegate->ReceivedAck();
- EXPECT_TRUE(delegate->tap_down());
- delegate->Reset();
-
- // Ack the move event.
- delegate->ReceivedAck();
- EXPECT_TRUE(delegate->tap_cancel());
- EXPECT_TRUE(delegate->scroll_begin());
- delegate->Reset();
-
- // Ack the release event. Although the release event has been processed, it
- // should still generate a scroll-end event.
- delegate->ReceivedAckPreventDefaulted();
- EXPECT_TRUE(delegate->scroll_end());
-
ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(55, 25), kTouchId2,
tes.Now());
ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::Point(45, 85), kTouchId2,