| Index: chrome/installer/util/google_update_settings_unittest.cc
|
| diff --git a/chrome/installer/util/google_update_settings_unittest.cc b/chrome/installer/util/google_update_settings_unittest.cc
|
| index 2f229ae84b723eeefae64b12ee557ddf4497a81a..b5767fef182be2c2da048a65bbe0a29a9ba7124d 100644
|
| --- a/chrome/installer/util/google_update_settings_unittest.cc
|
| +++ b/chrome/installer/util/google_update_settings_unittest.cc
|
| @@ -990,6 +990,36 @@ TEST_F(GoogleUpdateSettingsTest, ExperimentsLabelHelperUser) {
|
|
|
| #endif // defined(GOOGLE_CHROME_BUILD)
|
|
|
| +TEST_F(GoogleUpdateSettingsTest, GetDownloadPreference) {
|
| + RegKey policy_key;
|
| +
|
| + if (policy_key.Open(HKEY_LOCAL_MACHINE, GoogleUpdateSettings::kPoliciesKey,
|
| + KEY_SET_VALUE) == ERROR_SUCCESS) {
|
| + policy_key.DeleteValue(GoogleUpdateSettings::kDownloadPreference);
|
| + }
|
| + policy_key.Close();
|
| +
|
| + // When no policy is present expect to return an empty string.
|
| + EXPECT_TRUE(GoogleUpdateSettings::GetDownloadPreference().empty());
|
| +
|
| + // Expect "cacheable" when the correct policy is present.
|
| + EXPECT_EQ(ERROR_SUCCESS, policy_key.Create(HKEY_LOCAL_MACHINE,
|
| + GoogleUpdateSettings::kPoliciesKey,
|
| + KEY_SET_VALUE));
|
| + EXPECT_EQ(ERROR_SUCCESS,
|
| + policy_key.WriteValue(
|
| + GoogleUpdateSettings::kDownloadPreference,
|
| + GoogleUpdateSettings::kDownloadPreferenceCacheable));
|
| + EXPECT_STREQ(L"cacheable",
|
| + GoogleUpdateSettings::GetDownloadPreference().c_str());
|
| +
|
| + // Expect an empty string when an unsupported policy is set.
|
| + EXPECT_EQ(
|
| + ERROR_SUCCESS,
|
| + policy_key.WriteValue(GoogleUpdateSettings::kDownloadPreference, L"foo"));
|
| + EXPECT_TRUE(GoogleUpdateSettings::GetDownloadPreference().empty());
|
| +}
|
| +
|
| // Test GoogleUpdateSettings::GetUninstallCommandLine at system- or user-level,
|
| // according to the param.
|
| class GetUninstallCommandLine : public GoogleUpdateSettingsTest,
|
|
|