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 #include "chrome/test/base/ui_test_utils.h" | 5 #include "chrome/test/base/ui_test_utils.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 } | 162 } |
163 | 163 |
164 void NavigateToURL(chrome::NavigateParams* params) { | 164 void NavigateToURL(chrome::NavigateParams* params) { |
165 chrome::Navigate(params); | 165 chrome::Navigate(params); |
166 content::WaitForLoadStop(params->target_contents); | 166 content::WaitForLoadStop(params->target_contents); |
167 } | 167 } |
168 | 168 |
169 | 169 |
170 void NavigateToURLWithPost(Browser* browser, const GURL& url) { | 170 void NavigateToURLWithPost(Browser* browser, const GURL& url) { |
171 chrome::NavigateParams params(browser, url, | 171 chrome::NavigateParams params(browser, url, |
172 content::PAGE_TRANSITION_FORM_SUBMIT); | 172 ui::PAGE_TRANSITION_FORM_SUBMIT); |
173 params.uses_post = true; | 173 params.uses_post = true; |
174 NavigateToURL(¶ms); | 174 NavigateToURL(¶ms); |
175 } | 175 } |
176 | 176 |
177 void NavigateToURL(Browser* browser, const GURL& url) { | 177 void NavigateToURL(Browser* browser, const GURL& url) { |
178 NavigateToURLWithDisposition(browser, url, CURRENT_TAB, | 178 NavigateToURLWithDisposition(browser, url, CURRENT_TAB, |
179 BROWSER_TEST_WAIT_FOR_NAVIGATION); | 179 BROWSER_TEST_WAIT_FOR_NAVIGATION); |
180 } | 180 } |
181 | 181 |
182 // Navigates the specified tab (via |disposition|) of |browser| to |url|, | 182 // Navigates the specified tab (via |disposition|) of |browser| to |url|, |
(...skipping 15 matching lines...) Expand all Loading... |
198 | 198 |
199 std::set<Browser*> initial_browsers; | 199 std::set<Browser*> initial_browsers; |
200 for (chrome::BrowserIterator it; !it.done(); it.Next()) | 200 for (chrome::BrowserIterator it; !it.done(); it.Next()) |
201 initial_browsers.insert(*it); | 201 initial_browsers.insert(*it); |
202 | 202 |
203 content::WindowedNotificationObserver tab_added_observer( | 203 content::WindowedNotificationObserver tab_added_observer( |
204 chrome::NOTIFICATION_TAB_ADDED, | 204 chrome::NOTIFICATION_TAB_ADDED, |
205 content::NotificationService::AllSources()); | 205 content::NotificationService::AllSources()); |
206 | 206 |
207 browser->OpenURL(OpenURLParams( | 207 browser->OpenURL(OpenURLParams( |
208 url, Referrer(), disposition, content::PAGE_TRANSITION_TYPED, false)); | 208 url, Referrer(), disposition, ui::PAGE_TRANSITION_TYPED, false)); |
209 if (browser_test_flags & BROWSER_TEST_WAIT_FOR_BROWSER) | 209 if (browser_test_flags & BROWSER_TEST_WAIT_FOR_BROWSER) |
210 browser = WaitForBrowserNotInSet(initial_browsers); | 210 browser = WaitForBrowserNotInSet(initial_browsers); |
211 if (browser_test_flags & BROWSER_TEST_WAIT_FOR_TAB) | 211 if (browser_test_flags & BROWSER_TEST_WAIT_FOR_TAB) |
212 tab_added_observer.Wait(); | 212 tab_added_observer.Wait(); |
213 if (!(browser_test_flags & BROWSER_TEST_WAIT_FOR_NAVIGATION)) { | 213 if (!(browser_test_flags & BROWSER_TEST_WAIT_FOR_NAVIGATION)) { |
214 // Some other flag caused the wait prior to this. | 214 // Some other flag caused the wait prior to this. |
215 return; | 215 return; |
216 } | 216 } |
217 WebContents* web_contents = NULL; | 217 WebContents* web_contents = NULL; |
218 if (disposition == NEW_BACKGROUND_TAB) { | 218 if (disposition == NEW_BACKGROUND_TAB) { |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
575 | 575 |
576 void HistoryEnumerator::HistoryQueryComplete( | 576 void HistoryEnumerator::HistoryQueryComplete( |
577 const base::Closure& quit_task, | 577 const base::Closure& quit_task, |
578 history::QueryResults* results) { | 578 history::QueryResults* results) { |
579 for (size_t i = 0; i < results->size(); ++i) | 579 for (size_t i = 0; i < results->size(); ++i) |
580 urls_.push_back((*results)[i].url()); | 580 urls_.push_back((*results)[i].url()); |
581 quit_task.Run(); | 581 quit_task.Run(); |
582 } | 582 } |
583 | 583 |
584 } // namespace ui_test_utils | 584 } // namespace ui_test_utils |
OLD | NEW |