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

Unified Diff: chrome/browser/ui/startup/startup_browser_creator_browsertest.cc

Issue 660813002: [Win] Add a fast profile switcher to the Windows taskbar item. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: commas. commas are important Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/startup/startup_browser_creator_browsertest.cc
diff --git a/chrome/browser/ui/startup/startup_browser_creator_browsertest.cc b/chrome/browser/ui/startup/startup_browser_creator_browsertest.cc
index b8ef3a7e27dba6c5c668b0c43bd20e6f10074e65..81ff422654de07177879dce2a188a3ca1f168726 100644
--- a/chrome/browser/ui/startup/startup_browser_creator_browsertest.cc
+++ b/chrome/browser/ui/startup/startup_browser_creator_browsertest.cc
@@ -281,6 +281,28 @@ IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest,
ASSERT_EQ(1, new_browser->tab_strip_model()->count());
}
+#if defined(OS_WIN)
+IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest, ActivateExistingBrowser) {
+ // Initially, there should only be one browser open.
+ ASSERT_TRUE(browser());
+ EXPECT_EQ(1u, chrome::GetBrowserCount(browser()->profile(),
+ browser()->host_desktop_type()));
+
+ // Add --activate-existing-profile-browser to the command line and
+ // start a new process.
+ CommandLine dummy(CommandLine::NO_PROGRAM);
+ dummy.AppendSwitch(switches::kActivateExistingProfileBrowser);
+
+ StartupBrowserCreator::ProcessCommandLineAlreadyRunning(
+ dummy, base::FilePath(), browser()->profile()->GetPath());
+
+ // This should not have created a new browser window, and should have
+ // activated the existing browser.
+ EXPECT_EQ(1u, chrome::GetBrowserCount(browser()->profile(),
+ browser()->host_desktop_type()));
+}
+#endif
+
// App shortcuts are not implemented on mac os.
#if !defined(OS_MACOSX)
IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest, OpenAppShortcutNoPref) {
« no previous file with comments | « chrome/browser/ui/startup/startup_browser_creator.cc ('k') | chrome/browser/ui/views/profiles/avatar_menu_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698