OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_UI_TEST_UTILS_H_ | 5 #ifndef CHROME_TEST_UI_TEST_UTILS_H_ |
6 #define CHROME_TEST_UI_TEST_UTILS_H_ | 6 #define CHROME_TEST_UI_TEST_UTILS_H_ |
7 | 7 |
8 class Browser; | 8 class Browser; |
9 class GURL; | 9 class GURL; |
10 class NavigationController; | 10 class NavigationController; |
11 | 11 |
12 // A collections of functions designed for use with InProcessBrowserTest. | 12 // A collections of functions designed for use with InProcessBrowserTest. |
13 namespace ui_test_utils { | 13 namespace ui_test_utils { |
14 | 14 |
15 // Turns on nestable tasks, runs the message loop, then resets nestable tasks | 15 // Turns on nestable tasks, runs the message loop, then resets nestable tasks |
16 // to what they were originally. Prefer this over MessageLoop::Run for in | 16 // to what they were originally. Prefer this over MessageLoop::Run for in |
17 // process browser tests that need to block until a condition is met. | 17 // process browser tests that need to block until a condition is met. |
18 void RunMessageLoop(); | 18 void RunMessageLoop(); |
19 | 19 |
20 // Waits for |controller| to complete a navigation. This blocks until | 20 // Waits for |controller| to complete a navigation. This blocks until |
21 // the navigation finishes. | 21 // the navigation finishes. |
22 void WaitForNavigation(NavigationController* controller); | 22 void WaitForNavigation(NavigationController* controller); |
23 | 23 |
| 24 // Waits for |controller| to complete a navigation. This blocks until |
| 25 // the specified number of navigations complete. |
| 26 void WaitForNavigations(NavigationController* controller, |
| 27 int number_of_navigations); |
| 28 |
24 // Navigates the selected tab of |browser| to |url|, blocking until the | 29 // Navigates the selected tab of |browser| to |url|, blocking until the |
25 // navigation finishes. | 30 // navigation finishes. |
26 void NavigateToURL(Browser* browser, const GURL& url); | 31 void NavigateToURL(Browser* browser, const GURL& url); |
27 | 32 |
| 33 // Navigates the selected tab of |browser| to |url|, blocking until the |
| 34 // number of navigations specified complete. |
| 35 void NavigateToURLBlockUntilNavigationsComplete(Browser* browser, |
| 36 const GURL& url, |
| 37 int number_of_navigations); |
28 } | 38 } |
29 | 39 |
30 #endif // CHROME_TEST_UI_TEST_UTILS_H_ | 40 #endif // CHROME_TEST_UI_TEST_UTILS_H_ |
OLD | NEW |