Chromium Code Reviews| Index: chrome/browser/host_content_settings_map_unittest.cc |
| diff --git a/chrome/browser/host_content_settings_map_unittest.cc b/chrome/browser/host_content_settings_map_unittest.cc |
| index 1312d4396c0cb9c4503b583d4775ea43cf5043d9..c4e930daf5c0ffba705318a8d3aa9fcd45b60b31 100644 |
| --- a/chrome/browser/host_content_settings_map_unittest.cc |
| +++ b/chrome/browser/host_content_settings_map_unittest.cc |
| @@ -984,4 +984,33 @@ TEST_F(HostContentSettingsMapTest, SettingDefaultContentSettingsWhenManaged) { |
| CONTENT_SETTINGS_TYPE_PLUGINS)); |
| } |
| +TEST_F(HostContentSettingsMapTest, ResetToDefaultsWhenManaged) { |
| + TestingProfile profile; |
| + HostContentSettingsMap* host_content_settings_map = |
| + profile.GetHostContentSettingsMap(); |
| + TestingPrefService* prefs = profile.GetTestingPrefService(); |
| + |
| + prefs->SetManagedPref(prefs::kBlockThirdPartyCookies, Value::CreateBooleanValue(true)); |
|
jochen (gone - plz use gerrit)
2010/11/29 13:31:28
80c
markusheintz_
2010/11/29 13:58:02
Done.
|
| + prefs->SetUserPref(prefs::kBlockThirdPartyCookies, Value::CreateBooleanValue(true)); |
|
jochen (gone - plz use gerrit)
2010/11/29 13:31:28
80c
markusheintz_
2010/11/29 13:58:02
Done.
|
| + |
| + EXPECT_EQ(true, |
| + host_content_settings_map->IsBlockThirdPartyCookiesManaged()); |
| + EXPECT_EQ(true, host_content_settings_map->BlockThirdPartyCookies()); |
| + |
| + // Reset to the default value (false). |
| + host_content_settings_map->ResetToDefaults(); |
| + // Since the preference BlockThirdPartyCookies is managed the |
| + // HostContentSettingsMap should still return the managed value which is true. |
| + EXPECT_EQ(true, |
| + host_content_settings_map->IsBlockThirdPartyCookiesManaged()); |
| + EXPECT_EQ(true, host_content_settings_map->BlockThirdPartyCookies()); |
| + |
| + // After unsetting the managed value for the preference BlockThirdPartyCookies |
| + // the default value should be returned now. |
| + prefs->RemoveManagedPref(prefs::kBlockThirdPartyCookies); |
| + EXPECT_EQ(false, |
| + host_content_settings_map->IsBlockThirdPartyCookiesManaged()); |
| + EXPECT_EQ(false, host_content_settings_map->BlockThirdPartyCookies()); |
| +} |
| + |
| } // namespace |