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

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

Issue 250923004: Synthesize ctrl-wheel events on touchpad pinch (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix windows build and tweaks Created 6 years, 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <vector> 5 #include <vector>
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 88
89 void SimulateGestureScrollUpdateEvent(float dX, float dY, int modifiers) { 89 void SimulateGestureScrollUpdateEvent(float dX, float dY, int modifiers) {
90 SimulateGestureEvent( 90 SimulateGestureEvent(
91 SyntheticWebGestureEventBuilder::BuildScrollUpdate(dX, dY, modifiers)); 91 SyntheticWebGestureEventBuilder::BuildScrollUpdate(dX, dY, modifiers));
92 } 92 }
93 93
94 void SimulateGesturePinchUpdateEvent(float scale, 94 void SimulateGesturePinchUpdateEvent(float scale,
95 float anchorX, 95 float anchorX,
96 float anchorY, 96 float anchorY,
97 int modifiers) { 97 int modifiers) {
98 SimulateGestureEvent( 98 SimulateGestureEvent(SyntheticWebGestureEventBuilder::BuildPinchUpdate(
99 SyntheticWebGestureEventBuilder::BuildPinchUpdate(scale, 99 scale, anchorX, anchorY, modifiers, WebGestureEvent::Touchscreen));
100 anchorX,
101 anchorY,
102 modifiers));
103 } 100 }
104 101
105 void SimulateGestureFlingStartEvent( 102 void SimulateGestureFlingStartEvent(
106 float velocityX, 103 float velocityX,
107 float velocityY, 104 float velocityY,
108 WebGestureEvent::SourceDevice sourceDevice) { 105 WebGestureEvent::SourceDevice sourceDevice) {
109 SimulateGestureEvent( 106 SimulateGestureEvent(
110 SyntheticWebGestureEventBuilder::BuildFling(velocityX, 107 SyntheticWebGestureEventBuilder::BuildFling(velocityX,
111 velocityY, 108 velocityY,
112 sourceDevice)); 109 sourceDevice));
(...skipping 1077 matching lines...) Expand 10 before | Expand all | Expand 10 after
1190 gesture_event.data.flingStart.velocityX = 0.f; 1187 gesture_event.data.flingStart.velocityX = 0.f;
1191 gesture_event.data.flingStart.velocityY = 0.f; 1188 gesture_event.data.flingStart.velocityY = 0.f;
1192 ASSERT_EQ(0U, GetAndResetSentGestureEventCount()); 1189 ASSERT_EQ(0U, GetAndResetSentGestureEventCount());
1193 ASSERT_EQ(0U, GestureEventQueueSize()); 1190 ASSERT_EQ(0U, GestureEventQueueSize());
1194 EXPECT_FALSE(SimulateGestureEvent(gesture_event)); 1191 EXPECT_FALSE(SimulateGestureEvent(gesture_event));
1195 EXPECT_EQ(0U, GetAndResetSentGestureEventCount()); 1192 EXPECT_EQ(0U, GetAndResetSentGestureEventCount());
1196 EXPECT_EQ(0U, GestureEventQueueSize()); 1193 EXPECT_EQ(0U, GestureEventQueueSize());
1197 } 1194 }
1198 1195
1199 } // namespace content 1196 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698