Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(340)

Side by Side Diff: chrome/test/base/ui_test_utils.cc

Issue 16174003: Make all tests use GetActiveDesktop() instead of hardcoding HOST_DESKTOP_TYPE_NATIVE. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/test/base/in_process_browser_test.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/test/base/in_process_browser_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698