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) { |