OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ | 5 #ifndef CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ |
6 #define CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ | 6 #define CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ |
7 | 7 |
8 #include <queue> | 8 #include <queue> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
72 int modifiers, | 72 int modifiers, |
73 WebKit::WebMouseEvent::Button button, | 73 WebKit::WebMouseEvent::Button button, |
74 const gfx::Point& point); | 74 const gfx::Point& point); |
75 | 75 |
76 // Simulates asynchronously a mouse enter/move/leave event. | 76 // Simulates asynchronously a mouse enter/move/leave event. |
77 void SimulateMouseEvent(WebContents* web_contents, | 77 void SimulateMouseEvent(WebContents* web_contents, |
78 WebKit::WebInputEvent::Type type, | 78 WebKit::WebInputEvent::Type type, |
79 const gfx::Point& point); | 79 const gfx::Point& point); |
80 | 80 |
81 // Sends a key press asynchronously. | 81 // Sends a key press asynchronously. |
82 // The native code of the key event will be set to InvalidNativeKeycode(). | |
82 void SimulateKeyPress(WebContents* web_contents, | 83 void SimulateKeyPress(WebContents* web_contents, |
83 ui::KeyboardCode key, | 84 ui::KeyboardCode keyCode, |
tommi (sloooow) - chröme
2013/09/06 06:36:38
key_code
weitao
2013/09/06 17:59:35
Done.
| |
84 bool control, | 85 bool control, |
85 bool shift, | 86 bool shift, |
86 bool alt, | 87 bool alt, |
88 bool command); | |
89 | |
90 // Sends a key press asynchronously. | |
91 // |code| specifies the UIEvents (aka: DOM4Events) value of the key: | |
92 // https://dvcs.w3.org/hg/d4e/raw-file/tip/source_respec.htm | |
93 // The native code of the key event will be set based on |code|. | |
94 void SimulateKeyPressWithCode(WebContents* web_contents, | |
95 ui::KeyboardCode keyCode, | |
tommi (sloooow) - chröme
2013/09/06 06:36:38
key_code.
also fix indent please.
weitao
2013/09/06 17:59:35
Done.
| |
96 const char* code, | |
97 bool control, | |
98 bool shift, | |
99 bool alt, | |
87 bool command); | 100 bool command); |
88 | 101 |
89 // Allow ExecuteScript* methods to target either a WebContents or a | 102 // Allow ExecuteScript* methods to target either a WebContents or a |
90 // RenderViewHost. Targetting a WebContents means executing script in the | 103 // RenderViewHost. Targetting a WebContents means executing script in the |
91 // RenderViewHost returned by WebContents::GetRenderViewHost(), which is the | 104 // RenderViewHost returned by WebContents::GetRenderViewHost(), which is the |
92 // "current" RenderViewHost. Pass a specific RenderViewHost to target, for | 105 // "current" RenderViewHost. Pass a specific RenderViewHost to target, for |
93 // example, a "swapped-out" RenderViewHost. | 106 // example, a "swapped-out" RenderViewHost. |
94 namespace internal { | 107 namespace internal { |
95 class ToRenderViewHost { | 108 class ToRenderViewHost { |
96 public: | 109 public: |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
227 std::queue<std::string> message_queue_; | 240 std::queue<std::string> message_queue_; |
228 bool waiting_for_message_; | 241 bool waiting_for_message_; |
229 scoped_refptr<MessageLoopRunner> message_loop_runner_; | 242 scoped_refptr<MessageLoopRunner> message_loop_runner_; |
230 | 243 |
231 DISALLOW_COPY_AND_ASSIGN(DOMMessageQueue); | 244 DISALLOW_COPY_AND_ASSIGN(DOMMessageQueue); |
232 }; | 245 }; |
233 | 246 |
234 } // namespace content | 247 } // namespace content |
235 | 248 |
236 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ | 249 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ |
OLD | NEW |