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

Unified Diff: chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history_swiper_unit_test.mm

Issue 117733002: mac: Fix a newly introduced history swiping bug. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a forward declaration. Created 7 years 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 | « chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history_swiper.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history_swiper_unit_test.mm
diff --git a/chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history_swiper_unit_test.mm b/chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history_swiper_unit_test.mm
index 9765041979045024875cbeecd5f90cb43791cef1..a3b48b7ed8583eb9792204ded75274201798c2fc 100644
--- a/chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history_swiper_unit_test.mm
+++ b/chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history_swiper_unit_test.mm
@@ -275,3 +275,27 @@ TEST_F(MacHistorySwiperTest, NoSwipe) {
EXPECT_EQ(begin_count_, 0);
EXPECT_EQ(end_count_, 0);
}
+
+// After a gesture is successfully recognized, momentum events should be
+// swallowed, but new events should pass through.
+TEST_F(MacHistorySwiperTest, TouchEventAfterGestureFinishes) {
+ // These tests require 10.7+ APIs.
+ if (![NSEvent
+ respondsToSelector:@selector(isSwipeTrackingFromScrollEventsEnabled)])
+ return;
+
+ // Successfully pass through a gesture.
+ startGestureInMiddle();
+ moveGestureInMiddle();
+ moveGestureAtPoint(makePoint(0.8, 0.5));
+ endGestureAtPoint(makePoint(0.8, 0.5));
+ EXPECT_TRUE(navigated_right_);
+
+ // Momentum events should be swallowed.
+ NSEvent* momentumEvent = scrollWheelEventWithPhase(NSEventPhaseNone);
+ EXPECT_TRUE([historySwiper_ handleEvent:momentumEvent]);
+
+ // New events should not be swallowed.
+ NSEvent* beganEvent = scrollWheelEventWithPhase(NSEventPhaseBegan);
+ EXPECT_FALSE([historySwiper_ handleEvent:beganEvent]);
+}
« no previous file with comments | « chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history_swiper.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698