summaryrefslogtreecommitdiffstats
path: root/ui/aura/gestures
diff options
context:
space:
mode:
authorsadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-23 21:23:26 +0000
committersadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-23 21:23:26 +0000
commitd45bc23e7d6507bb9940d6ab39312281cab6bd40 (patch)
treedc2e57db26d302808db3f7e7fa16036f9e471f77 /ui/aura/gestures
parent474256c05f918b089502cad3f55be862c95cf6ac (diff)
downloadchromium_src-d45bc23e7d6507bb9940d6ab39312281cab6bd40.zip
chromium_src-d45bc23e7d6507bb9940d6ab39312281cab6bd40.tar.gz
chromium_src-d45bc23e7d6507bb9940d6ab39312281cab6bd40.tar.bz2
aura: Generate a double-click event for an unprocessed double-tap gesture.
BUG=115486 TEST=aura_unittests:GestureRecognizerTest:GestureTapSyntheticMouse Review URL: https://chromiumcodereview.appspot.com/9443026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@123336 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/aura/gestures')
-rw-r--r--ui/aura/gestures/gesture_recognizer_unittest.cc18
1 files changed, 17 insertions, 1 deletions
diff --git a/ui/aura/gestures/gesture_recognizer_unittest.cc b/ui/aura/gestures/gesture_recognizer_unittest.cc
index 28c09a5..ffe8e59 100644
--- a/ui/aura/gestures/gesture_recognizer_unittest.cc
+++ b/ui/aura/gestures/gesture_recognizer_unittest.cc
@@ -175,7 +175,8 @@ class GestureEventSynthDelegate : public TestWindowDelegate {
mouse_exit_(false),
mouse_press_(false),
mouse_release_(false),
- mouse_move_(false) {
+ mouse_move_(false),
+ double_click_(false) {
}
void Reset() {
@@ -184,6 +185,7 @@ class GestureEventSynthDelegate : public TestWindowDelegate {
mouse_press_ = false;
mouse_release_ = false;
mouse_move_ = false;
+ double_click_ = false;
}
bool mouse_enter() const { return mouse_enter_; }
@@ -191,10 +193,12 @@ class GestureEventSynthDelegate : public TestWindowDelegate {
bool mouse_press() const { return mouse_press_; }
bool mouse_move() const { return mouse_move_; }
bool mouse_release() const { return mouse_release_; }
+ bool double_click() const { return double_click_; }
virtual bool OnMouseEvent(MouseEvent* event) OVERRIDE {
switch (event->type()) {
case ui::ET_MOUSE_PRESSED:
+ double_click_ = event->flags() & ui::EF_IS_DOUBLE_CLICK;
mouse_press_ = true;
break;
case ui::ET_MOUSE_RELEASED:
@@ -221,6 +225,7 @@ class GestureEventSynthDelegate : public TestWindowDelegate {
bool mouse_press_;
bool mouse_release_;
bool mouse_move_;
+ bool double_click_;
DISALLOW_COPY_AND_ASSIGN(GestureEventSynthDelegate);
};
@@ -730,6 +735,17 @@ TEST_F(GestureRecognizerTest, GestureTapSyntheticMouse) {
EXPECT_TRUE(delegate->mouse_press());
EXPECT_TRUE(delegate->mouse_release());
EXPECT_TRUE(delegate->mouse_exit());
+ EXPECT_FALSE(delegate->double_click());
+
+ delegate->Reset();
+ GestureEvent tap2(ui::ET_GESTURE_DOUBLE_TAP, 20, 20, 0,
+ base::Time::Now(), 0, 0);
+ root_window()->DispatchGestureEvent(&tap2);
+ EXPECT_TRUE(delegate->mouse_enter());
+ EXPECT_TRUE(delegate->mouse_press());
+ EXPECT_TRUE(delegate->mouse_release());
+ EXPECT_TRUE(delegate->mouse_exit());
+ EXPECT_TRUE(delegate->double_click());
}
TEST_F(GestureRecognizerTest, AsynchronousGestureRecognition) {