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

Unified Diff: content/browser/renderer_host/input/input_router_impl_unittest.cc

Issue 181723006: Handle mac trackpad zoom via GesturePinch events (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: jdduke CR feedback and fix win build errors Created 6 years, 9 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
Index: content/browser/renderer_host/input/input_router_impl_unittest.cc
diff --git a/content/browser/renderer_host/input/input_router_impl_unittest.cc b/content/browser/renderer_host/input/input_router_impl_unittest.cc
index 37fe46258795bafa80027e102ce7deb2bfa29edf..9f6760b3139e23b3d29522135b0a9f8c294bfff2 100644
--- a/content/browser/renderer_host/input/input_router_impl_unittest.cc
+++ b/content/browser/renderer_host/input/input_router_impl_unittest.cc
@@ -965,6 +965,8 @@ TEST_F(InputRouterImplTest, GestureShowPressIsInOrder) {
EXPECT_EQ(1U, ack_handler_->GetAndResetAckCount());
// GesturePinchUpdate waits for an ack.
+ // This also verifies that GesturePinchUpdates for touchscreen are sent
+ // to the renderer (in contrast to the TrackpadPinchUpdate test).
SimulateGestureEvent(WebInputEvent::GesturePinchUpdate,
WebGestureEvent::Touchscreen);
EXPECT_EQ(1U, GetSentMessageCountAndResetSink());
@@ -1297,4 +1299,19 @@ TEST_F(InputRouterImplTest, DoubleTapGestureDependsOnFirstTap) {
EXPECT_EQ(0, client_->in_flight_event_count());
}
+// Test that GesturePinchUpdate is handled specially for trackpad
+TEST_F(InputRouterImplTest, TrackpadPinchUpdate) {
+ // For now Trackpad PinchUpdate events are just immediately ACKed
+ // as unconsumed without going to the renderer.
+ // TODO(rbyers): Update for wheel event behavior - crbug.com/289887.
+ // Note that the Touchscreen case is verified as NOT doing this as
+ // part of the ShowPressIsInOrder test.
+ SimulateGestureEvent(WebInputEvent::GesturePinchUpdate,
+ WebGestureEvent::Touchpad);
+ ASSERT_EQ(0U, GetSentMessageCountAndResetSink());
+ EXPECT_EQ(1U, ack_handler_->GetAndResetAckCount());
+ EXPECT_EQ(INPUT_EVENT_ACK_STATE_NOT_CONSUMED, ack_handler_->ack_state());
+ EXPECT_EQ(0, client_->in_flight_event_count());
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698