| Index: chrome/browser/ui/browser_command_controller_unittest.cc
|
| diff --git a/chrome/browser/ui/browser_command_controller_unittest.cc b/chrome/browser/ui/browser_command_controller_unittest.cc
|
| index 60ac52170faef588d77cea6cf7f31cb2e22a6d7e..2ea9e44b3fe4fc1987364d3e6abb366e76870163 100644
|
| --- a/chrome/browser/ui/browser_command_controller_unittest.cc
|
| +++ b/chrome/browser/ui/browser_command_controller_unittest.cc
|
| @@ -27,6 +27,16 @@
|
|
|
| typedef BrowserWithTestWindowTest BrowserCommandControllerTest;
|
|
|
| +static void EnableNewProfileManagement() {
|
| +#if defined(OS_ANDROID)
|
| + DCHECK(!CommandLine::ForCurrentProcess()->HasSwitch(
|
| + switches::kDisableNewProfileManagement));
|
| +#else
|
| + CommandLine::ForCurrentProcess()->AppendSwitch(
|
| + switches::kEnableNewProfileManagement);
|
| +#endif
|
| +}
|
| +
|
| TEST_F(BrowserCommandControllerTest, IsReservedCommandOrKey) {
|
| #if defined(OS_CHROMEOS)
|
| // F1-3 keys are reserved Chrome accelerators on Chrome OS.
|
| @@ -211,8 +221,7 @@ TEST_F(BrowserCommandControllerTest, NewAvatarMenuEnabledWhenOnlyOneProfile) {
|
| return;
|
|
|
| // The command line is reset at the end of every test by the test suite.
|
| - CommandLine::ForCurrentProcess()->AppendSwitch(
|
| - switches::kNewProfileManagement);
|
| + EnableNewProfileManagement();
|
| EXPECT_TRUE(switches::IsNewProfileManagement());
|
|
|
| TestingProfileManager testing_profile_manager(
|
| @@ -239,8 +248,7 @@ TEST_F(BrowserCommandControllerTest, NewAvatarMenuEnabledInGuestMode) {
|
| return;
|
|
|
| // The command line is reset at the end of every test by the test suite.
|
| - CommandLine::ForCurrentProcess()->AppendSwitch(
|
| - switches::kNewProfileManagement);
|
| + EnableNewProfileManagement();
|
| EXPECT_TRUE(switches::IsNewProfileManagement());
|
|
|
| TestingProfileManager testing_profile_manager(
|
| @@ -294,8 +302,7 @@ TEST_F(BrowserCommandControllerTest, AvatarMenuAlwaysDisabledInIncognitoMode) {
|
|
|
| // The new style avatar menu should also be disabled.
|
| // The command line is reset at the end of every test by the test suite.
|
| - CommandLine::ForCurrentProcess()->AppendSwitch(
|
| - switches::kNewProfileManagement);
|
| + EnableNewProfileManagement();
|
| EXPECT_TRUE(switches::IsNewProfileManagement());
|
| EXPECT_FALSE(command_updater->IsCommandEnabled(IDC_SHOW_AVATAR_MENU));
|
| }
|
|
|