| OLD | NEW |
| 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 Loading... |
| 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 }; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 void TouchMoveCausingScrollIfUncanceled(); | 132 void TouchMoveCausingScrollIfUncanceled(); |
| 129 void TouchCancel(); | 133 void TouchCancel(); |
| 130 void TouchEnd(); | 134 void TouchEnd(); |
| 131 | 135 |
| 132 void LeapForward(int milliseconds); | 136 void LeapForward(int milliseconds); |
| 133 | 137 |
| 134 void BeginDragWithFiles(const std::vector<std::string>& files); | 138 void BeginDragWithFiles(const std::vector<std::string>& files); |
| 135 | 139 |
| 136 void AddTouchPoint(float x, float y, gin::Arguments* args); | 140 void AddTouchPoint(float x, float y, gin::Arguments* args); |
| 137 | 141 |
| 138 void MouseDragBegin(); | |
| 139 void MouseDragEnd(); | |
| 140 | |
| 141 void GestureScrollBegin(gin::Arguments* args); | 142 void GestureScrollBegin(gin::Arguments* args); |
| 142 void GestureScrollEnd(gin::Arguments* args); | 143 void GestureScrollEnd(gin::Arguments* args); |
| 143 void GestureScrollUpdate(gin::Arguments* args); | 144 void GestureScrollUpdate(gin::Arguments* args); |
| 144 void GesturePinchBegin(gin::Arguments* args); | 145 void GesturePinchBegin(gin::Arguments* args); |
| 145 void GesturePinchEnd(gin::Arguments* args); | 146 void GesturePinchEnd(gin::Arguments* args); |
| 146 void GesturePinchUpdate(gin::Arguments* args); | 147 void GesturePinchUpdate(gin::Arguments* args); |
| 147 void GestureTap(gin::Arguments* args); | 148 void GestureTap(gin::Arguments* args); |
| 148 void GestureTapDown(gin::Arguments* args); | 149 void GestureTapDown(gin::Arguments* args); |
| 149 void GestureShowPress(gin::Arguments* args); | 150 void GestureShowPress(gin::Arguments* args); |
| 150 void GestureTapCancel(gin::Arguments* args); | 151 void GestureTapCancel(gin::Arguments* args); |
| 151 void GestureLongPress(gin::Arguments* args); | 152 void GestureLongPress(gin::Arguments* args); |
| 152 void GestureLongTap(gin::Arguments* args); | 153 void GestureLongTap(gin::Arguments* args); |
| 153 void GestureTwoFingerTap(gin::Arguments* args); | 154 void GestureTwoFingerTap(gin::Arguments* args); |
| 154 | 155 |
| 155 void ContinuousMouseScrollBy(gin::Arguments* args); | 156 void MouseScrollBy(gin::Arguments* args, bool continuous); |
| 156 void MouseMoveTo(gin::Arguments* args); | 157 void MouseMoveTo(gin::Arguments* args); |
| 157 void MouseLeave(); | 158 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); | 159 void ScheduleAsynchronousClick(int button_number, int modifiers); |
| 163 void ScheduleAsynchronousKeyDown(const std::string& code_str, | 160 void ScheduleAsynchronousKeyDown(const std::string& code_str, |
| 164 int modifiers, | 161 int modifiers, |
| 165 KeyLocationCode location); | 162 KeyLocationCode location); |
| 166 | 163 |
| 167 double GetCurrentEventTimeSec(); | 164 double GetCurrentEventTimeSec(); |
| 168 | 165 |
| 169 void DoLeapForward(int milliseconds); | 166 void DoLeapForward(int milliseconds); |
| 170 | 167 |
| 171 void SendCurrentTouchEvent(blink::WebInputEvent::Type, bool); | 168 void SendCurrentTouchEvent(blink::WebInputEvent::Type, bool); |
| 172 | 169 |
| 173 void GestureEvent(blink::WebInputEvent::Type, | 170 void GestureEvent(blink::WebInputEvent::Type, |
| 174 gin::Arguments*); | 171 gin::Arguments*); |
| 175 | 172 |
| 176 void UpdateClickCountForButton(blink::WebMouseEvent::Button); | 173 void UpdateClickCountForButton(blink::WebMouseEvent::Button); |
| 177 | 174 |
| 178 void InitMouseWheelEvent(gin::Arguments* args, | 175 void InitMouseWheelEvent(gin::Arguments* args, |
| 179 bool continuous, | 176 bool continuous, |
| 180 blink::WebMouseWheelEvent* event); | 177 blink::WebMouseWheelEvent* event, |
| 178 bool* send_gestures); |
| 181 void InitPointerProperties(gin::Arguments* args, | 179 void InitPointerProperties(gin::Arguments* args, |
| 182 blink::WebPointerProperties* e, | 180 blink::WebPointerProperties* e, |
| 183 float* radius_x, | 181 float* radius_x, |
| 184 float* radius_y); | 182 float* radius_y); |
| 185 | 183 |
| 186 void FinishDragAndDrop(const blink::WebMouseEvent&, blink::WebDragOperation); | 184 void FinishDragAndDrop(const blink::WebMouseEvent&, blink::WebDragOperation); |
| 187 | 185 |
| 188 void DoMouseUp(const blink::WebMouseEvent&); | 186 void DoMouseUp(const blink::WebMouseEvent&); |
| 189 void DoMouseMove(const blink::WebMouseEvent&); | 187 void DoMouseMove(const blink::WebMouseEvent&); |
| 190 void ReplaySavedEvents(); | 188 void ReplaySavedEvents(); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 int wm_sys_char_; | 237 int wm_sys_char_; |
| 240 int wm_sys_dead_char_; | 238 int wm_sys_dead_char_; |
| 241 #endif | 239 #endif |
| 242 | 240 |
| 243 WebTaskList task_list_; | 241 WebTaskList task_list_; |
| 244 | 242 |
| 245 TestInterfaces* interfaces_; | 243 TestInterfaces* interfaces_; |
| 246 WebTestDelegate* delegate_; | 244 WebTestDelegate* delegate_; |
| 247 blink::WebView* view_; | 245 blink::WebView* view_; |
| 248 | 246 |
| 247 bool send_wheel_gestures_; |
| 249 bool force_layout_on_events_; | 248 bool force_layout_on_events_; |
| 250 | 249 |
| 251 // When set to true (the default value), we batch mouse move and mouse up | 250 // When set to true (the default value), we batch mouse move and mouse up |
| 252 // events so we can simulate drag & drop. | 251 // events so we can simulate drag & drop. |
| 253 bool is_drag_mode_; | 252 bool is_drag_mode_; |
| 254 | 253 |
| 255 int touch_modifiers_; | 254 int touch_modifiers_; |
| 256 bool touch_cancelable_; | 255 bool touch_cancelable_; |
| 257 std::vector<blink::WebTouchPoint> touch_points_; | 256 std::vector<blink::WebTouchPoint> touch_points_; |
| 258 | 257 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 double last_event_timestamp_; | 296 double last_event_timestamp_; |
| 298 | 297 |
| 299 base::WeakPtrFactory<EventSender> weak_factory_; | 298 base::WeakPtrFactory<EventSender> weak_factory_; |
| 300 | 299 |
| 301 DISALLOW_COPY_AND_ASSIGN(EventSender); | 300 DISALLOW_COPY_AND_ASSIGN(EventSender); |
| 302 }; | 301 }; |
| 303 | 302 |
| 304 } // namespace test_runner | 303 } // namespace test_runner |
| 305 | 304 |
| 306 #endif // COMPONENTS_TEST_RUNNER_EVENT_SENDER_H_ | 305 #endif // COMPONENTS_TEST_RUNNER_EVENT_SENDER_H_ |
| OLD | NEW |