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..154d88a8f17a5a6a97ef984bfcccc1de994ce3be 100644 |
--- a/chrome/browser/ui/browser_command_controller_unittest.cc |
+++ b/chrome/browser/ui/browser_command_controller_unittest.cc |
@@ -448,6 +448,29 @@ TEST_F(BrowserCommandControllerFullscreenTest, |
EXPECT_FALSE(chrome::IsCommandEnabled(browser(), IDC_IMPORT_SETTINGS)); |
} |
+TEST_F(BrowserCommandControllerTest, DISABLED_OptionsConsistency) { |
msw
2017/02/20 01:01:12
File a bug, add a comment here that cites the bug
Hzj_jie
2017/02/20 21:15:40
Done.
|
+ TestingProfile* testprofile = browser()->profile()->AsTestingProfile(); |
msw
2017/02/20 01:01:12
nit: |profile| or |test_profile| to fit naming con
Hzj_jie
2017/02/20 21:15:40
Done.
|
+ // Setup guest session |
+ testprofile->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)); |
msw
2017/02/20 01:01:12
So, this check fails if you enabled the test right
Hzj_jie
2017/02/20 21:15:40
Yes, the two EXPECT_TRUEs fail because of the code
|
+} |
+ |
TEST_F(BrowserCommandControllerTest, IncognitoModeOnSigninAllowedPrefChange) { |
// Set up a profile with an off the record profile. |
std::unique_ptr<TestingProfile> profile1 = TestingProfile::Builder().Build(); |