Chromium Code Reviews| 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..2846164e4dcc6e260dffddfe1fab53e98e6fa1a3 100644 |
| --- a/chrome/browser/ui/startup/startup_browser_creator_browsertest.cc |
| +++ b/chrome/browser/ui/startup/startup_browser_creator_browsertest.cc |
| @@ -281,6 +281,27 @@ IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest, |
| ASSERT_EQ(1, new_browser->tab_strip_model()->count()); |
| } |
| +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())); |
| + EXPECT_TRUE(browser()->window()->IsActive()); |
|
tapted
2014/11/04 23:10:48
Calls to IsActive need to be in interactive_ui_tes
noms (inactive)
2014/11/10 21:46:08
I've just removed the check to active, and checkin
|
| +} |
| + |
| // App shortcuts are not implemented on mac os. |
| #if !defined(OS_MACOSX) |
| IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest, OpenAppShortcutNoPref) { |