Chromium Code Reviews| Index: chrome_frame/test/policy_settings_unittest.cc |
| diff --git a/chrome_frame/test/policy_settings_unittest.cc b/chrome_frame/test/policy_settings_unittest.cc |
| index c5062bd0058cfadf91064f190efc4369515fad7f..040db1328a3efd8fe3398e5365815e05cda12393 100644 |
| --- a/chrome_frame/test/policy_settings_unittest.cc |
| +++ b/chrome_frame/test/policy_settings_unittest.cc |
| @@ -30,7 +30,9 @@ void DeleteChromeFramePolicyEntries(HKEY root) { |
| key.DeleteKey(ASCIIToWide(policy::key::kRenderInChromeFrameList).c_str()); |
| key.DeleteKey(ASCIIToWide(policy::key::kRenderInHostList).c_str()); |
| key.DeleteKey(ASCIIToWide(policy::key::kChromeFrameContentTypes).c_str()); |
| - key.DeleteKey(ASCIIToWide(policy::key::kApplicationLocaleValue).c_str()); |
| + key.DeleteValue(ASCIIToWide(policy::key::kApplicationLocaleValue).c_str()); |
| + key.DeleteValue( |
| + ASCIIToWide(policy::key::kSuppressChromeFrameTurndownPrompt).c_str()); |
| } |
| } |
| @@ -104,6 +106,19 @@ bool SetCFPolicyString(HKEY policy_root, |
| return true; |
| } |
| +bool SetCFPolicyBool(HKEY policy_root, |
| + const char* policy_name, |
| + bool value) { |
| + RegKey policy_key; |
| + if (!InitializePolicyKey(policy_root, &policy_key)) |
| + return false; |
| + |
| + std::wstring policy_name_str(ASCIIToWide(policy_name)); |
| + EXPECT_EQ(ERROR_SUCCESS, |
| + policy_key.WriteValue(policy_name_str.c_str(), value ? 1U : 0U)); |
| + return true; |
| +} |
|
robertshield
2013/06/19 23:36:33
The return value for this function is never used,
grt (UTC plus 2)
2013/06/20 19:55:29
Rejiggered.
|
| + |
| } // end namespace |
| class PolicySettingsTest : public testing::Test { |
| @@ -246,3 +261,17 @@ TEST_F(PolicySettingsTest, AdditionalLaunchParameters) { |
| DeleteChromeFramePolicyEntries(root[i]); |
| } |
| } |
| + |
| +TEST_F(PolicySettingsTest, SuppressTurndownPrompt) { |
| + EXPECT_FALSE(PolicySettings::GetInstance()->suppress_turndown_prompt()); |
| + |
| + HKEY root[] = { HKEY_LOCAL_MACHINE, HKEY_CURRENT_USER }; |
| + for (int i = 0; i < arraysize(root); ++i) { |
| + SetCFPolicyBool(root[i], policy::key::kSuppressChromeFrameTurndownPrompt, |
| + true); |
| + ResetPolicySettings(); |
| + EXPECT_TRUE(PolicySettings::GetInstance()->suppress_turndown_prompt()); |
| + |
| + DeleteChromeFramePolicyEntries(root[i]); |
| + } |
| +} |