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

Side by Side Diff: chrome/browser/ui/startup/startup_browser_creator_browsertest.cc

Issue 931853003: [Win] Revert the profile switcher code from the jumplist. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: also remove kActivateExistingProfileBrowser Created 5 years, 10 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
« no previous file with comments | « chrome/browser/ui/startup/startup_browser_creator.cc ('k') | chrome/common/chrome_switches.h » ('j') | 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 <algorithm> 5 #include <algorithm>
6 #include <string> 6 #include <string>
7 7
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 browser()->host_desktop_type())); 273 browser()->host_desktop_type()));
274 274
275 // This should have created a new browser window. 275 // This should have created a new browser window.
276 Browser* new_browser = FindOneOtherBrowser(browser()); 276 Browser* new_browser = FindOneOtherBrowser(browser());
277 ASSERT_TRUE(new_browser); 277 ASSERT_TRUE(new_browser);
278 278
279 // The new browser should have exactly one tab (not the startup URLs). 279 // The new browser should have exactly one tab (not the startup URLs).
280 ASSERT_EQ(1, new_browser->tab_strip_model()->count()); 280 ASSERT_EQ(1, new_browser->tab_strip_model()->count());
281 } 281 }
282 282
283 #if defined(OS_WIN)
284 IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest, ActivateExistingBrowser) {
285 // Initially, there should only be one browser open.
286 ASSERT_TRUE(browser());
287 EXPECT_EQ(1u, chrome::GetBrowserCount(browser()->profile(),
288 browser()->host_desktop_type()));
289
290 // Add --activate-existing-profile-browser to the command line and
291 // start a new process.
292 base::CommandLine dummy(base::CommandLine::NO_PROGRAM);
293 dummy.AppendSwitch(switches::kActivateExistingProfileBrowser);
294
295 StartupBrowserCreator::ProcessCommandLineAlreadyRunning(
296 dummy, base::FilePath(), browser()->profile()->GetPath());
297
298 // This should not have created a new browser window, and should have
299 // activated the existing browser.
300 EXPECT_EQ(1u, chrome::GetBrowserCount(browser()->profile(),
301 browser()->host_desktop_type()));
302 }
303 #endif
304
305 // App shortcuts are not implemented on mac os. 283 // App shortcuts are not implemented on mac os.
306 #if !defined(OS_MACOSX) 284 #if !defined(OS_MACOSX)
307 IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest, OpenAppShortcutNoPref) { 285 IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest, OpenAppShortcutNoPref) {
308 // Load an app with launch.container = 'tab'. 286 // Load an app with launch.container = 'tab'.
309 const Extension* extension_app = NULL; 287 const Extension* extension_app = NULL;
310 ASSERT_NO_FATAL_FAILURE(LoadApp("app_with_tab_container", &extension_app)); 288 ASSERT_NO_FATAL_FAILURE(LoadApp("app_with_tab_container", &extension_app));
311 289
312 // Add --app-id=<extension->id()> to the command line. 290 // Add --app-id=<extension->id()> to the command line.
313 base::CommandLine command_line(base::CommandLine::NO_PROGRAM); 291 base::CommandLine command_line(base::CommandLine::NO_PROGRAM);
314 command_line.AppendSwitchASCII(switches::kAppId, extension_app->id()); 292 command_line.AppendSwitchASCII(switches::kAppId, extension_app->id());
(...skipping 1173 matching lines...) Expand 10 before | Expand all | Expand 10 after
1488 ASSERT_EQ(1, tab_strip->count()); 1466 ASSERT_EQ(1, tab_strip->count());
1489 EXPECT_EQ("title1.html", 1467 EXPECT_EQ("title1.html",
1490 tab_strip->GetWebContentsAt(0)->GetURL().ExtractFileName()); 1468 tab_strip->GetWebContentsAt(0)->GetURL().ExtractFileName());
1491 } 1469 }
1492 #endif // defined(ENABLE_CONFIGURATION_POLICY) 1470 #endif // defined(ENABLE_CONFIGURATION_POLICY)
1493 1471
1494 #endif // !defined(OS_LINUX) || !defined(GOOGLE_CHROME_BUILD) || 1472 #endif // !defined(OS_LINUX) || !defined(GOOGLE_CHROME_BUILD) ||
1495 // defined(ENABLE_CONFIGURATION_POLICY) 1473 // defined(ENABLE_CONFIGURATION_POLICY)
1496 1474
1497 #endif // !defined(OS_CHROMEOS) 1475 #endif // !defined(OS_CHROMEOS)
OLDNEW
« no previous file with comments | « chrome/browser/ui/startup/startup_browser_creator.cc ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698