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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 // tab is currently web_contents. Otherwise returns immediately. | 58 // tab is currently web_contents. Otherwise returns immediately. |
59 void WaitForLoadStop(WebContents* web_contents); | 59 void WaitForLoadStop(WebContents* web_contents); |
60 | 60 |
61 // Causes the specified web_contents to crash. Blocks until it is crashed. | 61 // Causes the specified web_contents to crash. Blocks until it is crashed. |
62 void CrashTab(WebContents* web_contents); | 62 void CrashTab(WebContents* web_contents); |
63 | 63 |
64 // Simulates clicking at the center of the given tab asynchronously; modifiers | 64 // Simulates clicking at the center of the given tab asynchronously; modifiers |
65 // may contain bits from WebInputEvent::Modifiers. | 65 // may contain bits from WebInputEvent::Modifiers. |
66 void SimulateMouseClick(WebContents* web_contents, | 66 void SimulateMouseClick(WebContents* web_contents, |
67 int modifiers, | 67 int modifiers, |
68 WebKit::WebMouseEvent::Button button); | 68 blink::WebMouseEvent::Button button); |
69 | 69 |
70 // Simulates clicking at the point |point| of the given tab asynchronously; | 70 // Simulates clicking at the point |point| of the given tab asynchronously; |
71 // modifiers may contain bits from WebInputEvent::Modifiers. | 71 // modifiers may contain bits from WebInputEvent::Modifiers. |
72 void SimulateMouseClickAt(WebContents* web_contents, | 72 void SimulateMouseClickAt(WebContents* web_contents, |
73 int modifiers, | 73 int modifiers, |
74 WebKit::WebMouseEvent::Button button, | 74 blink::WebMouseEvent::Button button, |
75 const gfx::Point& point); | 75 const gfx::Point& point); |
76 | 76 |
77 // Simulates asynchronously a mouse enter/move/leave event. | 77 // Simulates asynchronously a mouse enter/move/leave event. |
78 void SimulateMouseEvent(WebContents* web_contents, | 78 void SimulateMouseEvent(WebContents* web_contents, |
79 WebKit::WebInputEvent::Type type, | 79 blink::WebInputEvent::Type type, |
80 const gfx::Point& point); | 80 const gfx::Point& point); |
81 | 81 |
82 // Sends a key press asynchronously. | 82 // Sends a key press asynchronously. |
83 // The native code of the key event will be set to InvalidNativeKeycode(). | 83 // The native code of the key event will be set to InvalidNativeKeycode(). |
84 // |key_code| alone is good enough for scenarios that only need the char | 84 // |key_code| alone is good enough for scenarios that only need the char |
85 // value represented by a key event and not the physical key on the keyboard | 85 // value represented by a key event and not the physical key on the keyboard |
86 // or the keyboard layout. | 86 // or the keyboard layout. |
87 // For scenarios such as chromoting that need the native code, | 87 // For scenarios such as chromoting that need the native code, |
88 // SimulateKeyPressWithCode should be used. | 88 // SimulateKeyPressWithCode should be used. |
89 void SimulateKeyPress(WebContents* web_contents, | 89 void SimulateKeyPress(WebContents* web_contents, |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 std::queue<std::string> message_queue_; | 268 std::queue<std::string> message_queue_; |
269 bool waiting_for_message_; | 269 bool waiting_for_message_; |
270 scoped_refptr<MessageLoopRunner> message_loop_runner_; | 270 scoped_refptr<MessageLoopRunner> message_loop_runner_; |
271 | 271 |
272 DISALLOW_COPY_AND_ASSIGN(DOMMessageQueue); | 272 DISALLOW_COPY_AND_ASSIGN(DOMMessageQueue); |
273 }; | 273 }; |
274 | 274 |
275 } // namespace content | 275 } // namespace content |
276 | 276 |
277 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ | 277 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ |
OLD | NEW |