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

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

Issue 1852603002: Replacing most of web_task.h with base::Closure + base::WeakPtrFactory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move-mocks-to-test-runner
Patch Set: Rebasing... 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
« no previous file with comments | « no previous file | components/test_runner/event_sender.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
11 #include <string> 11 #include <string>
12 #include <vector> 12 #include <vector>
13 13
14 #include "base/macros.h" 14 #include "base/macros.h"
15 #include "base/memory/scoped_ptr.h" 15 #include "base/memory/scoped_ptr.h"
16 #include "base/memory/weak_ptr.h" 16 #include "base/memory/weak_ptr.h"
17 #include "build/build_config.h" 17 #include "build/build_config.h"
18 #include "components/test_runner/web_task.h"
19 #include "third_party/WebKit/public/platform/WebDragData.h" 18 #include "third_party/WebKit/public/platform/WebDragData.h"
20 #include "third_party/WebKit/public/platform/WebInputEventResult.h" 19 #include "third_party/WebKit/public/platform/WebInputEventResult.h"
21 #include "third_party/WebKit/public/platform/WebPoint.h" 20 #include "third_party/WebKit/public/platform/WebPoint.h"
22 #include "third_party/WebKit/public/web/WebDragOperation.h" 21 #include "third_party/WebKit/public/web/WebDragOperation.h"
23 #include "third_party/WebKit/public/web/WebInputEvent.h" 22 #include "third_party/WebKit/public/web/WebInputEvent.h"
24 #include "third_party/WebKit/public/web/WebTouchPoint.h" 23 #include "third_party/WebKit/public/web/WebTouchPoint.h"
25 24
26 namespace blink { 25 namespace blink {
27 class WebFrame; 26 class WebFrame;
28 class WebView; 27 class WebView;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 void DoDragDrop(const blink::WebDragData&, blink::WebDragOperationsMask); 61 void DoDragDrop(const blink::WebDragData&, blink::WebDragOperationsMask);
63 62
64 void MouseDown(int button_number, int modifiers); 63 void MouseDown(int button_number, int modifiers);
65 void MouseUp(int button_number, int modifiers); 64 void MouseUp(int button_number, int modifiers);
66 void SetMouseButtonState(int button_number, int modifiers); 65 void SetMouseButtonState(int button_number, int modifiers);
67 66
68 void KeyDown(const std::string& code_str, 67 void KeyDown(const std::string& code_str,
69 int modifiers, 68 int modifiers,
70 KeyLocationCode location); 69 KeyLocationCode location);
71 70
72 WebTaskList* mutable_task_list() { return &task_list_; }
73
74 void set_send_wheel_gestures(bool send_wheel_gestures) { 71 void set_send_wheel_gestures(bool send_wheel_gestures) {
75 send_wheel_gestures_ = send_wheel_gestures; 72 send_wheel_gestures_ = send_wheel_gestures;
76 } 73 }
77 74
78 private: 75 private:
79 friend class EventSenderBindings; 76 friend class EventSenderBindings;
80 77
81 struct SavedEvent { 78 struct SavedEvent {
82 enum SavedEventType { 79 enum SavedEventType {
83 TYPE_UNSPECIFIED, 80 TYPE_UNSPECIFIED,
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 int wm_key_down_; 233 int wm_key_down_;
237 int wm_key_up_; 234 int wm_key_up_;
238 int wm_char_; 235 int wm_char_;
239 int wm_dead_char_; 236 int wm_dead_char_;
240 int wm_sys_key_down_; 237 int wm_sys_key_down_;
241 int wm_sys_key_up_; 238 int wm_sys_key_up_;
242 int wm_sys_char_; 239 int wm_sys_char_;
243 int wm_sys_dead_char_; 240 int wm_sys_dead_char_;
244 #endif 241 #endif
245 242
246 WebTaskList task_list_;
247
248 TestInterfaces* interfaces_; 243 TestInterfaces* interfaces_;
249 WebTestDelegate* delegate_; 244 WebTestDelegate* delegate_;
250 blink::WebView* view_; 245 blink::WebView* view_;
251 246
252 bool send_wheel_gestures_; 247 bool send_wheel_gestures_;
253 bool force_layout_on_events_; 248 bool force_layout_on_events_;
254 249
255 // 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
256 // events so we can simulate drag & drop. 251 // events so we can simulate drag & drop.
257 bool is_drag_mode_; 252 bool is_drag_mode_;
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 double last_event_timestamp_; 296 double last_event_timestamp_;
302 297
303 base::WeakPtrFactory<EventSender> weak_factory_; 298 base::WeakPtrFactory<EventSender> weak_factory_;
304 299
305 DISALLOW_COPY_AND_ASSIGN(EventSender); 300 DISALLOW_COPY_AND_ASSIGN(EventSender);
306 }; 301 };
307 302
308 } // namespace test_runner 303 } // namespace test_runner
309 304
310 #endif // COMPONENTS_TEST_RUNNER_EVENT_SENDER_H_ 305 #endif // COMPONENTS_TEST_RUNNER_EVENT_SENDER_H_
OLDNEW
« no previous file with comments | « no previous file | components/test_runner/event_sender.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698