diff options
Diffstat (limited to 'chrome/browser/ui/browser_command_controller_unittest.cc')
-rw-r--r-- | chrome/browser/ui/browser_command_controller_unittest.cc | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/chrome/browser/ui/browser_command_controller_unittest.cc b/chrome/browser/ui/browser_command_controller_unittest.cc index e906fcf..9fe9857 100644 --- a/chrome/browser/ui/browser_command_controller_unittest.cc +++ b/chrome/browser/ui/browser_command_controller_unittest.cc @@ -175,7 +175,9 @@ TEST_F(BrowserCommandControllerTest, OldAvatarMenuEnabledForOneOrMoreProfiles) { if (!profiles::IsMultipleProfilesEnabled()) return; - EXPECT_FALSE(switches::IsNewAvatarMenu()); + // The command line is reset at the end of every test by the test suite. + switches::DisableNewAvatarMenuForTesting(CommandLine::ForCurrentProcess()); + ASSERT_FALSE(switches::IsNewAvatarMenu()); TestingProfileManager testing_profile_manager( TestingBrowserProcess::GetGlobal()); @@ -284,14 +286,15 @@ TEST_F(BrowserCommandControllerTest, AvatarMenuAlwaysDisabledInIncognitoMode) { chrome::BrowserCommandController command_controller(otr_browser.get()); const CommandUpdater* command_updater = command_controller.command_updater(); - // The old style avatar menu should be disabled. - EXPECT_FALSE(switches::IsNewAvatarMenu()); + // Both the old style and the new style avatar menu should be disabled. EXPECT_FALSE(command_updater->IsCommandEnabled(IDC_SHOW_AVATAR_MENU)); - - // The new style avatar menu should also be disabled. - // The command line is reset at the end of every test by the test suite. - switches::EnableNewAvatarMenuForTesting(CommandLine::ForCurrentProcess()); + if (switches::IsNewAvatarMenu()) { + switches::DisableNewAvatarMenuForTesting(CommandLine::ForCurrentProcess()); + } else { + switches::EnableNewAvatarMenuForTesting(CommandLine::ForCurrentProcess()); + } EXPECT_FALSE(command_updater->IsCommandEnabled(IDC_SHOW_AVATAR_MENU)); + // The command line is reset at the end of every test by the test suite. } ////////////////////////////////////////////////////////////////////////////// |