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

Side by Side Diff: chrome/browser/ui/browser_navigator_browsertest.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
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/browser/ui/browser_navigator_browsertest.h" 5 #include "chrome/browser/ui/browser_navigator_browsertest.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "chrome/app/chrome_command_ids.h" 9 #include "chrome/app/chrome_command_ids.h"
10 #include "chrome/browser/prefs/incognito_mode_prefs.h" 10 #include "chrome/browser/prefs/incognito_mode_prefs.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 Browser* browser) const { 72 Browser* browser) const {
73 chrome::NavigateParams params(browser, GetGoogleURL(), 73 chrome::NavigateParams params(browser, GetGoogleURL(),
74 content::PAGE_TRANSITION_LINK); 74 content::PAGE_TRANSITION_LINK);
75 params.window_action = chrome::NavigateParams::SHOW_WINDOW; 75 params.window_action = chrome::NavigateParams::SHOW_WINDOW;
76 return params; 76 return params;
77 } 77 }
78 78
79 Browser* BrowserNavigatorTest::CreateEmptyBrowserForType(Browser::Type type, 79 Browser* BrowserNavigatorTest::CreateEmptyBrowserForType(Browser::Type type,
80 Profile* profile) { 80 Profile* profile) {
81 Browser* browser = new Browser( 81 Browser* browser = new Browser(
82 Browser::CreateParams(type, profile, chrome::HOST_DESKTOP_TYPE_NATIVE)); 82 Browser::CreateParams(type, profile, chrome::GetActiveDesktop()));
83 chrome::AddBlankTabAt(browser, -1, true); 83 chrome::AddBlankTabAt(browser, -1, true);
84 return browser; 84 return browser;
85 } 85 }
86 86
87 Browser* BrowserNavigatorTest::CreateEmptyBrowserForApp(Browser::Type type, 87 Browser* BrowserNavigatorTest::CreateEmptyBrowserForApp(Browser::Type type,
88 Profile* profile) { 88 Profile* profile) {
89 Browser* browser = new Browser( 89 Browser* browser = new Browser(
90 Browser::CreateParams::CreateForApp( 90 Browser::CreateParams::CreateForApp(
91 Browser::TYPE_POPUP, "Test", gfx::Rect(), profile, 91 Browser::TYPE_POPUP, "Test", gfx::Rect(), profile,
92 chrome::HOST_DESKTOP_TYPE_NATIVE)); 92 chrome::GetActiveDesktop()));
93 chrome::AddBlankTabAt(browser, -1, true); 93 chrome::AddBlankTabAt(browser, -1, true);
94 return browser; 94 return browser;
95 } 95 }
96 96
97 WebContents* BrowserNavigatorTest::CreateWebContents() { 97 WebContents* BrowserNavigatorTest::CreateWebContents() {
98 content::WebContents::CreateParams create_params(browser()->profile()); 98 content::WebContents::CreateParams create_params(browser()->profile());
99 content::WebContents* base_web_contents = 99 content::WebContents* base_web_contents =
100 browser()->tab_strip_model()->GetActiveWebContents(); 100 browser()->tab_strip_model()->GetActiveWebContents();
101 if (base_web_contents) { 101 if (base_web_contents) {
102 create_params.initial_size = 102 create_params.initial_size =
(...skipping 1182 matching lines...) Expand 10 before | Expand all | Expand 10 after
1285 ui_test_utils::NavigateToURL(&viewsource_params); 1285 ui_test_utils::NavigateToURL(&viewsource_params);
1286 1286
1287 chrome::NavigateParams singleton_params(browser(), 1287 chrome::NavigateParams singleton_params(browser(),
1288 GURL(chrome::kChromeUIVersionURL), 1288 GURL(chrome::kChromeUIVersionURL),
1289 content::PAGE_TRANSITION_LINK); 1289 content::PAGE_TRANSITION_LINK);
1290 singleton_params.disposition = SINGLETON_TAB; 1290 singleton_params.disposition = SINGLETON_TAB;
1291 EXPECT_EQ(-1, chrome::GetIndexOfSingletonTab(&singleton_params)); 1291 EXPECT_EQ(-1, chrome::GetIndexOfSingletonTab(&singleton_params));
1292 } 1292 }
1293 1293
1294 } // namespace 1294 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698