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

Side by Side Diff: components/test_runner/event_sender.h

Issue 1806103002: Send wheel gestures from event sender. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Mike's comments in patch set 1 Created 4 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 unified diff | Download patch
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 #ifndef COMPONENTS_TEST_RUNNER_EVENT_SENDER_H_ 5 #ifndef COMPONENTS_TEST_RUNNER_EVENT_SENDER_H_
6 #define COMPONENTS_TEST_RUNNER_EVENT_SENDER_H_ 6 #define COMPONENTS_TEST_RUNNER_EVENT_SENDER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <queue> 10 #include <queue>
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 void MouseDown(int button_number, int modifiers); 64 void MouseDown(int button_number, int modifiers);
65 void MouseUp(int button_number, int modifiers); 65 void MouseUp(int button_number, int modifiers);
66 void SetMouseButtonState(int button_number, int modifiers); 66 void SetMouseButtonState(int button_number, int modifiers);
67 67
68 void KeyDown(const std::string& code_str, 68 void KeyDown(const std::string& code_str,
69 int modifiers, 69 int modifiers,
70 KeyLocationCode location); 70 KeyLocationCode location);
71 71
72 WebTaskList* mutable_task_list() { return &task_list_; } 72 WebTaskList* mutable_task_list() { return &task_list_; }
73 73
74 void set_send_wheel_gestures(bool send_wheel_gestures) {
75 send_wheel_gestures_ = send_wheel_gestures;
76 }
77
74 private: 78 private:
75 friend class EventSenderBindings; 79 friend class EventSenderBindings;
76 80
77 struct SavedEvent { 81 struct SavedEvent {
78 enum SavedEventType { 82 enum SavedEventType {
79 TYPE_UNSPECIFIED, 83 TYPE_UNSPECIFIED,
80 TYPE_MOUSE_UP, 84 TYPE_MOUSE_UP,
81 TYPE_MOUSE_MOVE, 85 TYPE_MOUSE_MOVE,
82 TYPE_LEAP_FORWARD 86 TYPE_LEAP_FORWARD
83 }; 87 };
84 88
85 SavedEvent(); 89 SavedEvent();
86 90
87 SavedEventType type; 91 SavedEventType type;
88 blink::WebMouseEvent::Button button_type; // For MouseUp. 92 blink::WebMouseEvent::Button button_type; // For MouseUp.
89 blink::WebPoint pos; // For MouseMove. 93 blink::WebPoint pos; // For MouseMove.
90 int milliseconds; // For LeapForward. 94 int milliseconds; // For LeapForward.
91 int modifiers; 95 int modifiers;
92 }; 96 };
93 97
98 enum class MouseScrollType { PIXEL, TICK };
99
94 void EnableDOMUIEventLogging(); 100 void EnableDOMUIEventLogging();
95 void FireKeyboardEventsToElement(); 101 void FireKeyboardEventsToElement();
96 void ClearKillRing(); 102 void ClearKillRing();
97 103
98 std::vector<std::string> ContextClick(); 104 std::vector<std::string> ContextClick();
99 105
100 void TextZoomIn(); 106 void TextZoomIn();
101 void TextZoomOut(); 107 void TextZoomOut();
102 108
103 void ZoomPageIn(); 109 void ZoomPageIn();
(...skipping 24 matching lines...) Expand all
128 void TouchMoveCausingScrollIfUncanceled(); 134 void TouchMoveCausingScrollIfUncanceled();
129 void TouchCancel(); 135 void TouchCancel();
130 void TouchEnd(); 136 void TouchEnd();
131 137
132 void LeapForward(int milliseconds); 138 void LeapForward(int milliseconds);
133 139
134 void BeginDragWithFiles(const std::vector<std::string>& files); 140 void BeginDragWithFiles(const std::vector<std::string>& files);
135 141
136 void AddTouchPoint(float x, float y, gin::Arguments* args); 142 void AddTouchPoint(float x, float y, gin::Arguments* args);
137 143
138 void MouseDragBegin();
139 void MouseDragEnd();
140
141 void GestureScrollBegin(gin::Arguments* args); 144 void GestureScrollBegin(gin::Arguments* args);
142 void GestureScrollEnd(gin::Arguments* args); 145 void GestureScrollEnd(gin::Arguments* args);
143 void GestureScrollUpdate(gin::Arguments* args); 146 void GestureScrollUpdate(gin::Arguments* args);
144 void GesturePinchBegin(gin::Arguments* args); 147 void GesturePinchBegin(gin::Arguments* args);
145 void GesturePinchEnd(gin::Arguments* args); 148 void GesturePinchEnd(gin::Arguments* args);
146 void GesturePinchUpdate(gin::Arguments* args); 149 void GesturePinchUpdate(gin::Arguments* args);
147 void GestureTap(gin::Arguments* args); 150 void GestureTap(gin::Arguments* args);
148 void GestureTapDown(gin::Arguments* args); 151 void GestureTapDown(gin::Arguments* args);
149 void GestureShowPress(gin::Arguments* args); 152 void GestureShowPress(gin::Arguments* args);
150 void GestureTapCancel(gin::Arguments* args); 153 void GestureTapCancel(gin::Arguments* args);
151 void GestureLongPress(gin::Arguments* args); 154 void GestureLongPress(gin::Arguments* args);
152 void GestureLongTap(gin::Arguments* args); 155 void GestureLongTap(gin::Arguments* args);
153 void GestureTwoFingerTap(gin::Arguments* args); 156 void GestureTwoFingerTap(gin::Arguments* args);
154 157
155 void ContinuousMouseScrollBy(gin::Arguments* args); 158 void MouseScrollBy(gin::Arguments* args, MouseScrollType scroll_type);
156 void MouseMoveTo(gin::Arguments* args); 159 void MouseMoveTo(gin::Arguments* args);
157 void MouseLeave(); 160 void MouseLeave();
158 void TrackpadScrollBegin();
159 void TrackpadScroll(gin::Arguments* args);
160 void TrackpadScrollEnd();
161 void MouseScrollBy(gin::Arguments* args);
162 void ScheduleAsynchronousClick(int button_number, int modifiers); 161 void ScheduleAsynchronousClick(int button_number, int modifiers);
163 void ScheduleAsynchronousKeyDown(const std::string& code_str, 162 void ScheduleAsynchronousKeyDown(const std::string& code_str,
164 int modifiers, 163 int modifiers,
165 KeyLocationCode location); 164 KeyLocationCode location);
166 165
167 double GetCurrentEventTimeSec(); 166 double GetCurrentEventTimeSec();
168 167
169 void DoLeapForward(int milliseconds); 168 void DoLeapForward(int milliseconds);
170 169
171 void SendCurrentTouchEvent(blink::WebInputEvent::Type, bool); 170 void SendCurrentTouchEvent(blink::WebInputEvent::Type, bool);
172 171
173 void GestureEvent(blink::WebInputEvent::Type, 172 void GestureEvent(blink::WebInputEvent::Type,
174 gin::Arguments*); 173 gin::Arguments*);
175 174
176 void UpdateClickCountForButton(blink::WebMouseEvent::Button); 175 void UpdateClickCountForButton(blink::WebMouseEvent::Button);
177 176
178 void InitMouseWheelEvent(gin::Arguments* args, 177 void InitMouseWheelEvent(gin::Arguments* args,
179 bool continuous, 178 MouseScrollType scroll_type,
180 blink::WebMouseWheelEvent* event); 179 blink::WebMouseWheelEvent* event,
180 bool* send_gestures);
181 void InitPointerProperties(gin::Arguments* args, 181 void InitPointerProperties(gin::Arguments* args,
182 blink::WebPointerProperties* e, 182 blink::WebPointerProperties* e,
183 float* radius_x, 183 float* radius_x,
184 float* radius_y); 184 float* radius_y);
185 185
186 void FinishDragAndDrop(const blink::WebMouseEvent&, blink::WebDragOperation); 186 void FinishDragAndDrop(const blink::WebMouseEvent&, blink::WebDragOperation);
187 187
188 void DoMouseUp(const blink::WebMouseEvent&); 188 void DoMouseUp(const blink::WebMouseEvent&);
189 void DoMouseMove(const blink::WebMouseEvent&); 189 void DoMouseMove(const blink::WebMouseEvent&);
190 void ReplaySavedEvents(); 190 void ReplaySavedEvents();
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 int wm_sys_char_; 239 int wm_sys_char_;
240 int wm_sys_dead_char_; 240 int wm_sys_dead_char_;
241 #endif 241 #endif
242 242
243 WebTaskList task_list_; 243 WebTaskList task_list_;
244 244
245 TestInterfaces* interfaces_; 245 TestInterfaces* interfaces_;
246 WebTestDelegate* delegate_; 246 WebTestDelegate* delegate_;
247 blink::WebView* view_; 247 blink::WebView* view_;
248 248
249 bool send_wheel_gestures_;
249 bool force_layout_on_events_; 250 bool force_layout_on_events_;
250 251
251 // When set to true (the default value), we batch mouse move and mouse up 252 // When set to true (the default value), we batch mouse move and mouse up
252 // events so we can simulate drag & drop. 253 // events so we can simulate drag & drop.
253 bool is_drag_mode_; 254 bool is_drag_mode_;
254 255
255 int touch_modifiers_; 256 int touch_modifiers_;
256 bool touch_cancelable_; 257 bool touch_cancelable_;
257 std::vector<blink::WebTouchPoint> touch_points_; 258 std::vector<blink::WebTouchPoint> touch_points_;
258 259
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 double last_event_timestamp_; 298 double last_event_timestamp_;
298 299
299 base::WeakPtrFactory<EventSender> weak_factory_; 300 base::WeakPtrFactory<EventSender> weak_factory_;
300 301
301 DISALLOW_COPY_AND_ASSIGN(EventSender); 302 DISALLOW_COPY_AND_ASSIGN(EventSender);
302 }; 303 };
303 304
304 } // namespace test_runner 305 } // namespace test_runner
305 306
306 #endif // COMPONENTS_TEST_RUNNER_EVENT_SENDER_H_ 307 #endif // COMPONENTS_TEST_RUNNER_EVENT_SENDER_H_
OLDNEW
« no previous file with comments | « no previous file | components/test_runner/event_sender.cc » ('j') | components/test_runner/event_sender.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698