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 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 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <queue> | 9 #include <queue> |
10 #include <set> | 10 #include <set> |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 BROWSER_TEST_WAIT_FOR_NAVIGATION = 1 << 2, // Wait for navigation to finish. | 67 BROWSER_TEST_WAIT_FOR_NAVIGATION = 1 << 2, // Wait for navigation to finish. |
68 | 68 |
69 BROWSER_TEST_MASK = BROWSER_TEST_WAIT_FOR_BROWSER | | 69 BROWSER_TEST_MASK = BROWSER_TEST_WAIT_FOR_BROWSER | |
70 BROWSER_TEST_WAIT_FOR_TAB | | 70 BROWSER_TEST_WAIT_FOR_TAB | |
71 BROWSER_TEST_WAIT_FOR_NAVIGATION | 71 BROWSER_TEST_WAIT_FOR_NAVIGATION |
72 }; | 72 }; |
73 | 73 |
74 // Puts the current tab title in |title|. Returns true on success. | 74 // Puts the current tab title in |title|. Returns true on success. |
75 bool GetCurrentTabTitle(const Browser* browser, base::string16* title); | 75 bool GetCurrentTabTitle(const Browser* browser, base::string16* title); |
76 | 76 |
77 // Opens |url| in an incognito browser window with the incognito profile of | |
78 // |profile|, blocking until the navigation finishes. This will create a new | |
79 // browser if a browser with the incognito profile does not exist. Returns the | |
80 // incognito window Browser. | |
81 Browser* OpenURLOffTheRecord(Profile* profile, const GURL& url); | |
82 | |
83 // Performs the provided navigation process, blocking until the navigation | 77 // Performs the provided navigation process, blocking until the navigation |
84 // finishes. May change the params in some cases (i.e. if the navigation | 78 // finishes. May change the params in some cases (i.e. if the navigation |
85 // opens a new browser window). Uses chrome::Navigate. | 79 // opens a new browser window). Uses chrome::Navigate. |
86 void NavigateToURL(chrome::NavigateParams* params); | 80 void NavigateToURL(chrome::NavigateParams* params); |
87 | 81 |
88 // Navigates the selected tab of |browser| to |url|, blocking until the | 82 // Navigates the selected tab of |browser| to |url|, blocking until the |
89 // navigation finishes. Simulates a POST and uses chrome::Navigate. | 83 // navigation finishes. Simulates a POST and uses chrome::Navigate. |
90 void NavigateToURLWithPost(Browser* browser, const GURL& url); | 84 void NavigateToURLWithPost(Browser* browser, const GURL& url); |
91 | 85 |
92 // Navigates the selected tab of |browser| to |url|, blocking until the | 86 // Navigates the selected tab of |browser| to |url|, blocking until the |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 std::vector<GURL> urls_; | 287 std::vector<GURL> urls_; |
294 | 288 |
295 base::CancelableTaskTracker tracker_; | 289 base::CancelableTaskTracker tracker_; |
296 | 290 |
297 DISALLOW_COPY_AND_ASSIGN(HistoryEnumerator); | 291 DISALLOW_COPY_AND_ASSIGN(HistoryEnumerator); |
298 }; | 292 }; |
299 | 293 |
300 } // namespace ui_test_utils | 294 } // namespace ui_test_utils |
301 | 295 |
302 #endif // CHROME_TEST_BASE_UI_TEST_UTILS_H_ | 296 #endif // CHROME_TEST_BASE_UI_TEST_UTILS_H_ |
OLD | NEW |