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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 // Generate a URL for a file path including a query string. | 52 // Generate a URL for a file path including a query string. |
53 GURL GetFileUrlWithQuery(const FilePath& path, const std::string& query_string); | 53 GURL GetFileUrlWithQuery(const FilePath& path, const std::string& query_string); |
54 | 54 |
55 // Waits for a load stop for the specified |web_contents|'s controller, if the | 55 // Waits for a load stop for the specified |web_contents|'s controller, if the |
56 // tab is currently web_contents. Otherwise returns immediately. | 56 // tab is currently web_contents. Otherwise returns immediately. |
57 void WaitForLoadStop(WebContents* web_contents); | 57 void WaitForLoadStop(WebContents* web_contents); |
58 | 58 |
59 // Causes the specified web_contents to crash. Blocks until it is crashed. | 59 // Causes the specified web_contents to crash. Blocks until it is crashed. |
60 void CrashTab(WebContents* web_contents); | 60 void CrashTab(WebContents* web_contents); |
61 | 61 |
62 // Simulates clicking at the center of the given tab asynchronously. | 62 // Simulates clicking at the center of the given tab asynchronously; modifiers |
63 void SimulateMouseClick(WebContents* web_contents); | 63 // may contain bits from WebInputEvent::Modifiers. |
| 64 void SimulateMouseClick(WebContents* web_contents, |
| 65 int modifiers, |
| 66 WebKit::WebMouseEvent::Button button); |
64 | 67 |
65 // Simulates asynchronously a mouse enter/move/leave event. | 68 // Simulates asynchronously a mouse enter/move/leave event. |
66 void SimulateMouseEvent(WebContents* web_contents, | 69 void SimulateMouseEvent(WebContents* web_contents, |
67 WebKit::WebInputEvent::Type type, | 70 WebKit::WebInputEvent::Type type, |
68 const gfx::Point& point); | 71 const gfx::Point& point); |
69 | 72 |
70 // Sends a key press asynchronously. | 73 // Sends a key press asynchronously. |
71 void SimulateKeyPress(WebContents* web_contents, | 74 void SimulateKeyPress(WebContents* web_contents, |
72 ui::KeyboardCode key, | 75 ui::KeyboardCode key, |
73 bool control, | 76 bool control, |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 std::queue<std::string> message_queue_; | 243 std::queue<std::string> message_queue_; |
241 bool waiting_for_message_; | 244 bool waiting_for_message_; |
242 scoped_refptr<MessageLoopRunner> message_loop_runner_; | 245 scoped_refptr<MessageLoopRunner> message_loop_runner_; |
243 | 246 |
244 DISALLOW_COPY_AND_ASSIGN(DOMMessageQueue); | 247 DISALLOW_COPY_AND_ASSIGN(DOMMessageQueue); |
245 }; | 248 }; |
246 | 249 |
247 } // namespace content | 250 } // namespace content |
248 | 251 |
249 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ | 252 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ |
OLD | NEW |