OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_TEST_BASE_UI_TEST_UTILS_H_ | 5 #ifndef CHROME_TEST_BASE_UI_TEST_UTILS_H_ |
6 #define CHROME_TEST_BASE_UI_TEST_UTILS_H_ | 6 #define CHROME_TEST_BASE_UI_TEST_UTILS_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <queue> | 10 #include <queue> |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 bool case_sensitive, | 223 bool case_sensitive, |
224 int* ordinal); | 224 int* ordinal); |
225 | 225 |
226 // Returns true if the View is focused. | 226 // Returns true if the View is focused. |
227 bool IsViewFocused(const Browser* browser, ViewID vid); | 227 bool IsViewFocused(const Browser* browser, ViewID vid); |
228 | 228 |
229 // Simulates a mouse click on a View in the browser. | 229 // Simulates a mouse click on a View in the browser. |
230 void ClickOnView(const Browser* browser, ViewID vid); | 230 void ClickOnView(const Browser* browser, ViewID vid); |
231 | 231 |
232 // Blocks until a notification for given |type| is received. | 232 // Blocks until a notification for given |type| is received. |
| 233 // TODO(gbillock): remove this race hazard. |
| 234 // Use WindowedNotificationObserver instead. |
233 void WaitForNotification(int type); | 235 void WaitForNotification(int type); |
234 | 236 |
235 // Blocks until a notification for given |type| from the specified |source| | 237 // Blocks until a notification for given |type| from the specified |source| |
236 // is received. | 238 // is received. |
| 239 // TODO(gbillock): remove this race hazard. |
| 240 // Use WindowedNotificationObserver instead. |
237 void WaitForNotificationFrom(int type, | 241 void WaitForNotificationFrom(int type, |
238 const NotificationSource& source); | 242 const NotificationSource& source); |
239 | 243 |
240 // Register |observer| for the given |type| and |source| and run | 244 // Register |observer| for the given |type| and |source| and run |
241 // the message loop until the observer posts a quit task. | 245 // the message loop until the observer posts a quit task. |
242 void RegisterAndWait(NotificationObserver* observer, | 246 void RegisterAndWait(NotificationObserver* observer, |
243 int type, | 247 int type, |
244 const NotificationSource& source); | 248 const NotificationSource& source); |
245 | 249 |
246 // Blocks until |model| finishes loading. | 250 // Blocks until |model| finishes loading. |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
600 | 604 |
601 // Takes a snapshot of the entire page, according to the width and height | 605 // Takes a snapshot of the entire page, according to the width and height |
602 // properties of the DOM's document. Returns true on success. DOMAutomation | 606 // properties of the DOM's document. Returns true on success. DOMAutomation |
603 // must be enabled. | 607 // must be enabled. |
604 bool TakeEntirePageSnapshot(RenderViewHost* rvh, | 608 bool TakeEntirePageSnapshot(RenderViewHost* rvh, |
605 SkBitmap* bitmap) WARN_UNUSED_RESULT; | 609 SkBitmap* bitmap) WARN_UNUSED_RESULT; |
606 | 610 |
607 } // namespace ui_test_utils | 611 } // namespace ui_test_utils |
608 | 612 |
609 #endif // CHROME_TEST_BASE_UI_TEST_UTILS_H_ | 613 #endif // CHROME_TEST_BASE_UI_TEST_UTILS_H_ |
OLD | NEW |