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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 if (new_browser == NULL) { | 151 if (new_browser == NULL) { |
152 BrowserAddedObserver observer; | 152 BrowserAddedObserver observer; |
153 new_browser = observer.WaitForSingleNewBrowser(); | 153 new_browser = observer.WaitForSingleNewBrowser(); |
154 // The new browser should never be in |excluded_browsers|. | 154 // The new browser should never be in |excluded_browsers|. |
155 DCHECK(!ContainsKey(excluded_browsers, new_browser)); | 155 DCHECK(!ContainsKey(excluded_browsers, new_browser)); |
156 } | 156 } |
157 return new_browser; | 157 return new_browser; |
158 } | 158 } |
159 | 159 |
160 Browser* OpenURLOffTheRecord(Profile* profile, const GURL& url) { | 160 Browser* OpenURLOffTheRecord(Profile* profile, const GURL& url) { |
161 chrome::OpenURLOffTheRecord(profile, url, chrome::HOST_DESKTOP_TYPE_NATIVE); | 161 chrome::HostDesktopType active_desktop = chrome::GetActiveDesktop(); |
| 162 chrome::OpenURLOffTheRecord(profile, url, active_desktop); |
162 Browser* browser = chrome::FindTabbedBrowser( | 163 Browser* browser = chrome::FindTabbedBrowser( |
163 profile->GetOffTheRecordProfile(), | 164 profile->GetOffTheRecordProfile(), false, active_desktop); |
164 false, | |
165 chrome::HOST_DESKTOP_TYPE_NATIVE); | |
166 WaitForNavigations( | 165 WaitForNavigations( |
167 &browser->tab_strip_model()->GetActiveWebContents()->GetController(), | 166 &browser->tab_strip_model()->GetActiveWebContents()->GetController(), |
168 1); | 167 1); |
169 return browser; | 168 return browser; |
170 } | 169 } |
171 | 170 |
172 void NavigateToURL(chrome::NavigateParams* params) { | 171 void NavigateToURL(chrome::NavigateParams* params) { |
173 chrome::Navigate(params); | 172 chrome::Navigate(params); |
174 content::WaitForLoadStop(params->target_contents); | 173 content::WaitForLoadStop(params->target_contents); |
175 } | 174 } |
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
551 void HistoryEnumerator::HistoryQueryComplete( | 550 void HistoryEnumerator::HistoryQueryComplete( |
552 const base::Closure& quit_task, | 551 const base::Closure& quit_task, |
553 HistoryService::Handle request_handle, | 552 HistoryService::Handle request_handle, |
554 history::QueryResults* results) { | 553 history::QueryResults* results) { |
555 for (size_t i = 0; i < results->size(); ++i) | 554 for (size_t i = 0; i < results->size(); ++i) |
556 urls_.push_back((*results)[i].url()); | 555 urls_.push_back((*results)[i].url()); |
557 quit_task.Run(); | 556 quit_task.Run(); |
558 } | 557 } |
559 | 558 |
560 } // namespace ui_test_utils | 559 } // namespace ui_test_utils |
OLD | NEW |