Chromium Code Reviews| 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 ee63765fe5508834673edd0e6ad399b019dc081d..d683cc7e2ac6c2bec46bf3b73331e3b1a91493c7 100644 |
| --- a/chrome/browser/ui/browser_command_controller_unittest.cc |
| +++ b/chrome/browser/ui/browser_command_controller_unittest.cc |
| @@ -448,6 +448,30 @@ TEST_F(BrowserCommandControllerFullscreenTest, |
| EXPECT_FALSE(chrome::IsCommandEnabled(browser(), IDC_IMPORT_SETTINGS)); |
| } |
| +// Code defect is tracked by bug, http://crbug.com/694331. |
|
msw
2017/02/23 19:07:28
nit: replace this comment with something like: "En
Hzj_jie
2017/02/23 22:00:09
Done.
|
| +TEST_F(BrowserCommandControllerTest, OptionsConsistency) { |
| + TestingProfile* profile = browser()->profile()->AsTestingProfile(); |
| + // Setup guest session. |
| + profile->SetGuestSession(true); |
| + // Setup forced incognito mode. |
| + IncognitoModePrefs::SetAvailability(browser()->profile()->GetPrefs(), |
| + IncognitoModePrefs::FORCED); |
| + EXPECT_TRUE(chrome::IsCommandEnabled(browser(), IDC_OPTIONS)); |
| + // Enter fullscreen. |
| + browser()->command_controller()->FullscreenStateChanged(); |
| + EXPECT_TRUE(chrome::IsCommandEnabled(browser(), IDC_OPTIONS)); |
| + // Exit fullscreen |
| + browser()->command_controller()->FullscreenStateChanged(); |
| + EXPECT_TRUE(chrome::IsCommandEnabled(browser(), IDC_OPTIONS)); |
| + // Reenter incognito mode, this should trigger |
| + // UpdateSharedCommandsForIncognitoAvailability() again. |
| + IncognitoModePrefs::SetAvailability(browser()->profile()->GetPrefs(), |
| + IncognitoModePrefs::DISABLED); |
| + IncognitoModePrefs::SetAvailability(browser()->profile()->GetPrefs(), |
| + IncognitoModePrefs::FORCED); |
| + EXPECT_TRUE(chrome::IsCommandEnabled(browser(), IDC_OPTIONS)); |
| +} |
| + |
| TEST_F(BrowserCommandControllerTest, IncognitoModeOnSigninAllowedPrefChange) { |
| // Set up a profile with an off the record profile. |
| std::unique_ptr<TestingProfile> profile1 = TestingProfile::Builder().Build(); |