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

Side by Side Diff: content/browser/renderer_host/input/input_router_impl_unittest.cc

Issue 1800143002: Notify Blink about start of gesture scroll through a queued event. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/renderer_host/input/input_router_impl.h" 5 #include "content/browser/renderer_host/input/input_router_impl.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 1213 matching lines...) Expand 10 before | Expand all | Expand 10 after
1224 } 1224 }
1225 1225
1226 // Test that GestureShowPress events don't get out of order due to 1226 // Test that GestureShowPress events don't get out of order due to
1227 // ignoring their acks. 1227 // ignoring their acks.
1228 TEST_F(InputRouterImplTest, GestureShowPressIsInOrder) { 1228 TEST_F(InputRouterImplTest, GestureShowPressIsInOrder) {
1229 SimulateGestureEvent(WebInputEvent::GestureScrollBegin, 1229 SimulateGestureEvent(WebInputEvent::GestureScrollBegin,
1230 blink::WebGestureDeviceTouchscreen); 1230 blink::WebGestureDeviceTouchscreen);
1231 EXPECT_EQ(1U, GetSentMessageCountAndResetSink()); 1231 EXPECT_EQ(1U, GetSentMessageCountAndResetSink());
1232 EXPECT_EQ(1U, ack_handler_->GetAndResetAckCount()); 1232 EXPECT_EQ(1U, ack_handler_->GetAndResetAckCount());
1233 1233
1234
1235 // GesturePinchBegin ignores its ack. 1234 // GesturePinchBegin ignores its ack.
1236 SimulateGestureEvent(WebInputEvent::GesturePinchBegin, 1235 SimulateGestureEvent(WebInputEvent::GesturePinchBegin,
1237 blink::WebGestureDeviceTouchscreen); 1236 blink::WebGestureDeviceTouchscreen);
1238 EXPECT_EQ(1U, GetSentMessageCountAndResetSink()); 1237 EXPECT_EQ(1U, GetSentMessageCountAndResetSink());
1239 EXPECT_EQ(1U, ack_handler_->GetAndResetAckCount()); 1238 EXPECT_EQ(1U, ack_handler_->GetAndResetAckCount());
1240 1239
1241 // GesturePinchUpdate waits for an ack. 1240 // GesturePinchUpdate waits for an ack.
1242 // This also verifies that GesturePinchUpdates for touchscreen are sent 1241 // This also verifies that GesturePinchUpdates for touchscreen are sent
1243 // to the renderer (in contrast to the TrackpadPinchUpdate test). 1242 // to the renderer (in contrast to the TrackpadPinchUpdate test).
1244 SimulateGestureEvent(WebInputEvent::GesturePinchUpdate, 1243 SimulateGestureEvent(WebInputEvent::GesturePinchUpdate,
(...skipping 1082 matching lines...) Expand 10 before | Expand all | Expand 10 after
2327 EXPECT_EQ(80, sent_event->data.flingStart.velocityY); 2326 EXPECT_EQ(80, sent_event->data.flingStart.velocityY);
2328 2327
2329 const WebGestureEvent* filter_event = 2328 const WebGestureEvent* filter_event =
2330 GetFilterWebInputEvent<WebGestureEvent>(); 2329 GetFilterWebInputEvent<WebGestureEvent>();
2331 TestLocationInFilterEvent(filter_event, orig); 2330 TestLocationInFilterEvent(filter_event, orig);
2332 EXPECT_EQ(30, filter_event->data.flingStart.velocityX); 2331 EXPECT_EQ(30, filter_event->data.flingStart.velocityX);
2333 EXPECT_EQ(40, filter_event->data.flingStart.velocityY); 2332 EXPECT_EQ(40, filter_event->data.flingStart.velocityY);
2334 } 2333 }
2335 2334
2336 } // namespace content 2335 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/input/input_router_impl.cc ('k') | content/browser/renderer_host/input/touch_event_queue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698