| Index: chrome/browser/content_settings/content_settings_pref_provider_unittest.cc
|
| diff --git a/chrome/browser/content_settings/content_settings_pref_provider_unittest.cc b/chrome/browser/content_settings/content_settings_pref_provider_unittest.cc
|
| index 50e56ff33e2d45e30f7f8eb2b308a789f08b9551..172fd9a1d02f58bd1d4411556c45794afdf5eaae 100644
|
| --- a/chrome/browser/content_settings/content_settings_pref_provider_unittest.cc
|
| +++ b/chrome/browser/content_settings/content_settings_pref_provider_unittest.cc
|
| @@ -8,6 +8,7 @@
|
| #include "base/command_line.h"
|
| #include "base/memory/scoped_ptr.h"
|
| #include "base/threading/platform_thread.h"
|
| +#include "base/values.h"
|
| #include "chrome/browser/content_settings/content_settings_mock_observer.h"
|
| #include "chrome/browser/content_settings/content_settings_utils.h"
|
| #include "chrome/browser/prefs/browser_prefs.h"
|
| @@ -142,12 +143,12 @@ TEST_F(PrefProviderTest, Observer) {
|
|
|
| pref_content_settings_provider.AddObserver(&mock_observer);
|
|
|
| - pref_content_settings_provider.SetContentSetting(
|
| + pref_content_settings_provider.SetWebsiteSetting(
|
| pattern,
|
| ContentSettingsPattern::Wildcard(),
|
| CONTENT_SETTINGS_TYPE_IMAGES,
|
| "",
|
| - CONTENT_SETTING_ALLOW);
|
| + Value::CreateIntegerValue(CONTENT_SETTING_ALLOW));
|
|
|
| pref_content_settings_provider.ShutdownOnUIThread();
|
| }
|
| @@ -181,12 +182,12 @@ TEST_F(PrefProviderTest, Incognito) {
|
| PrefProvider pref_content_settings_provider_incognito(otr_prefs, true);
|
| ContentSettingsPattern pattern =
|
| ContentSettingsPattern::FromString("[*.]example.com");
|
| - pref_content_settings_provider.SetContentSetting(
|
| + pref_content_settings_provider.SetWebsiteSetting(
|
| pattern,
|
| pattern,
|
| CONTENT_SETTINGS_TYPE_IMAGES,
|
| "",
|
| - CONTENT_SETTING_ALLOW);
|
| + Value::CreateIntegerValue(CONTENT_SETTING_ALLOW));
|
|
|
| GURL host("http://example.com/");
|
| // The value should of course be visible in the regular PrefProvider.
|
| @@ -223,11 +224,12 @@ TEST_F(PrefProviderTest, GetContentSettingsValue) {
|
| &provider, primary_url, primary_url,
|
| CONTENT_SETTINGS_TYPE_IMAGES, "", false));
|
|
|
| - provider.SetContentSetting(primary_pattern,
|
| - primary_pattern,
|
| - CONTENT_SETTINGS_TYPE_IMAGES,
|
| - "",
|
| - CONTENT_SETTING_BLOCK);
|
| + provider.SetWebsiteSetting(
|
| + primary_pattern,
|
| + primary_pattern,
|
| + CONTENT_SETTINGS_TYPE_IMAGES,
|
| + "",
|
| + Value::CreateIntegerValue(CONTENT_SETTING_BLOCK));
|
| EXPECT_EQ(CONTENT_SETTING_BLOCK,
|
| GetContentSetting(&provider, primary_url, primary_url,
|
| CONTENT_SETTINGS_TYPE_IMAGES, "", false));
|
| @@ -238,11 +240,11 @@ TEST_F(PrefProviderTest, GetContentSettingsValue) {
|
| value_ptr->GetAsInteger(&int_value);
|
| EXPECT_EQ(CONTENT_SETTING_BLOCK, IntToContentSetting(int_value));
|
|
|
| - provider.SetContentSetting(primary_pattern,
|
| + provider.SetWebsiteSetting(primary_pattern,
|
| primary_pattern,
|
| CONTENT_SETTINGS_TYPE_IMAGES,
|
| "",
|
| - CONTENT_SETTING_DEFAULT);
|
| + NULL);
|
| EXPECT_EQ(NULL,
|
| GetContentSettingValue(
|
| &provider, primary_url, primary_url,
|
| @@ -270,12 +272,12 @@ TEST_F(PrefProviderTest, Patterns) {
|
| GetContentSetting(
|
| &pref_content_settings_provider,
|
| host1, host1, CONTENT_SETTINGS_TYPE_IMAGES, "", false));
|
| - pref_content_settings_provider.SetContentSetting(
|
| + pref_content_settings_provider.SetWebsiteSetting(
|
| pattern1,
|
| pattern1,
|
| CONTENT_SETTINGS_TYPE_IMAGES,
|
| "",
|
| - CONTENT_SETTING_BLOCK);
|
| + Value::CreateIntegerValue(CONTENT_SETTING_BLOCK));
|
| EXPECT_EQ(CONTENT_SETTING_BLOCK,
|
| GetContentSetting(
|
| &pref_content_settings_provider,
|
| @@ -289,12 +291,12 @@ TEST_F(PrefProviderTest, Patterns) {
|
| GetContentSetting(
|
| &pref_content_settings_provider,
|
| host3, host3, CONTENT_SETTINGS_TYPE_IMAGES, "", false));
|
| - pref_content_settings_provider.SetContentSetting(
|
| + pref_content_settings_provider.SetWebsiteSetting(
|
| pattern2,
|
| pattern2,
|
| CONTENT_SETTINGS_TYPE_IMAGES,
|
| "",
|
| - CONTENT_SETTING_BLOCK);
|
| + Value::CreateIntegerValue(CONTENT_SETTING_BLOCK));
|
| EXPECT_EQ(CONTENT_SETTING_BLOCK,
|
| GetContentSetting(
|
| &pref_content_settings_provider,
|
| @@ -304,12 +306,12 @@ TEST_F(PrefProviderTest, Patterns) {
|
| GetContentSetting(&pref_content_settings_provider,
|
| host4, host4, CONTENT_SETTINGS_TYPE_IMAGES, "",
|
| false));
|
| - pref_content_settings_provider.SetContentSetting(
|
| + pref_content_settings_provider.SetWebsiteSetting(
|
| pattern3,
|
| pattern3,
|
| CONTENT_SETTINGS_TYPE_IMAGES,
|
| "",
|
| - CONTENT_SETTING_BLOCK);
|
| + Value::CreateIntegerValue(CONTENT_SETTING_BLOCK));
|
| EXPECT_EQ(CONTENT_SETTING_BLOCK,
|
| GetContentSetting(
|
| &pref_content_settings_provider,
|
| @@ -334,12 +336,12 @@ TEST_F(PrefProviderTest, ResourceIdentifier) {
|
| &pref_content_settings_provider,
|
| host, host, CONTENT_SETTINGS_TYPE_PLUGINS,
|
| resource1, false));
|
| - pref_content_settings_provider.SetContentSetting(
|
| + pref_content_settings_provider.SetWebsiteSetting(
|
| pattern,
|
| pattern,
|
| CONTENT_SETTINGS_TYPE_PLUGINS,
|
| resource1,
|
| - CONTENT_SETTING_BLOCK);
|
| + Value::CreateIntegerValue(CONTENT_SETTING_BLOCK));
|
| EXPECT_EQ(CONTENT_SETTING_BLOCK,
|
| GetContentSetting(
|
| &pref_content_settings_provider,
|
| @@ -422,11 +424,11 @@ TEST_F(PrefProviderTest, SyncObsoletePref) {
|
| ContentSettingsPattern::FromString("[*.]example.com");
|
| ContentSettingsPattern secondary_pattern =
|
| ContentSettingsPattern::Wildcard();
|
| - provider.SetContentSetting(primary_pattern,
|
| + provider.SetWebsiteSetting(primary_pattern,
|
| secondary_pattern,
|
| CONTENT_SETTINGS_TYPE_JAVASCRIPT,
|
| std::string(),
|
| - CONTENT_SETTING_BLOCK);
|
| + Value::CreateIntegerValue(CONTENT_SETTING_BLOCK));
|
|
|
| // Test whether the obsolete preference is synced correctly.
|
| patterns = prefs->GetDictionary(prefs::kContentSettingsPatterns);
|
| @@ -688,12 +690,12 @@ TEST_F(PrefProviderTest, AutoSubmitCertificateContentSetting) {
|
| std::string(),
|
| false));
|
|
|
| - provider.SetContentSetting(
|
| + provider.SetWebsiteSetting(
|
| ContentSettingsPattern::FromURL(primary_url),
|
| ContentSettingsPattern::Wildcard(),
|
| CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE,
|
| std::string(),
|
| - CONTENT_SETTING_ALLOW);
|
| + Value::CreateIntegerValue(CONTENT_SETTING_ALLOW));
|
| EXPECT_EQ(CONTENT_SETTING_ALLOW,
|
| GetContentSetting(
|
| &provider,
|
|
|