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

Unified Diff: ash/wm/system_gesture_event_filter_unittest.cc

Issue 10037012: Three Finger Swipe (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Remove pinch/scroll start/end calls Created 8 years, 8 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 | « ash/wm/system_gesture_event_filter.cc ('k') | chrome/browser/ui/gesture_prefs_observer_factory_aura.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/system_gesture_event_filter_unittest.cc
diff --git a/ash/wm/system_gesture_event_filter_unittest.cc b/ash/wm/system_gesture_event_filter_unittest.cc
index 35c7596eac7c6506ad8c4610c4cdf85128b8ef5f..8e26aec587700321ff735bb796e6d531f5cbd629 100644
--- a/ash/wm/system_gesture_event_filter_unittest.cc
+++ b/ash/wm/system_gesture_event_filter_unittest.cc
@@ -47,4 +47,31 @@ TEST_F(SystemGestureEventFilterTest, TapOutsideRootWindow) {
EXPECT_FALSE(consumed);
}
+// Ensure that a three fingered swipe is consumed by the system event handler.
+TEST_F(SystemGestureEventFilterTest, ThreeFingerSwipe) {
+ aura::RootWindow* root_window = Shell::GetRootWindow();
+
+ const int kTouchId = 5;
+
+ // Get a target for kTouchId
+ aura::TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(100, 100), kTouchId,
+ base::Time::NowFromSystemTime() - base::Time());
+ root_window->DispatchTouchEvent(&press);
+
+ aura::GestureEvent* event = new aura::GestureEvent(
+ ui::ET_GESTURE_THREE_FINGER_SWIPE, 0, 0, 0, base::Time::Now(),
+ 0, 0, 1 << kTouchId);
+ bool consumed = root_window->DispatchGestureEvent(event);
+
+ EXPECT_TRUE(consumed);
+
+ // The system event filter shouldn't filter out events like tap downs.
+ aura::GestureEvent* event2 = new aura::GestureEvent(
+ ui::ET_GESTURE_TAP_DOWN, 0, 0, 0, base::Time::Now(),
+ 0, 0, 1 << kTouchId);
+ consumed = root_window->DispatchGestureEvent(event2);
+
+ EXPECT_FALSE(consumed);
+}
+
} // namespace ash
« no previous file with comments | « ash/wm/system_gesture_event_filter.cc ('k') | chrome/browser/ui/gesture_prefs_observer_factory_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698