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..0872b83830bd53c2adc37351a2817648cce0d078 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,17 @@ bool SetCFPolicyString(HKEY policy_root, |
return true; |
} |
+void SetCFPolicyBool(HKEY policy_root, |
+ const char* policy_name, |
+ bool value) { |
+ RegKey policy_key; |
+ if (InitializePolicyKey(policy_root, &policy_key)) { |
+ std::wstring policy_name_str(ASCIIToWide(policy_name)); |
+ EXPECT_EQ(ERROR_SUCCESS, |
+ policy_key.WriteValue(policy_name_str.c_str(), value ? 1U : 0U)); |
+ } |
+} |
+ |
} // end namespace |
class PolicySettingsTest : public testing::Test { |
@@ -246,3 +259,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]); |
+ } |
+} |