| Index: chrome/browser/content_settings/host_content_settings_map_unittest.cc
|
| diff --git a/chrome/browser/content_settings/host_content_settings_map_unittest.cc b/chrome/browser/content_settings/host_content_settings_map_unittest.cc
|
| index 0c782fa333bb7cf7d2db15b64ec5bc066b39a984..176c66fad3cb9b5b24f8c1552a462281a5bb6861 100644
|
| --- a/chrome/browser/content_settings/host_content_settings_map_unittest.cc
|
| +++ b/chrome/browser/content_settings/host_content_settings_map_unittest.cc
|
| @@ -11,6 +11,7 @@
|
| #include "base/prefs/scoped_user_pref_update.h"
|
| #include "chrome/browser/content_settings/content_settings_mock_observer.h"
|
| #include "chrome/browser/content_settings/cookie_settings_factory.h"
|
| +#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
|
| #include "chrome/browser/content_settings/mock_settings_observer.h"
|
| #include "chrome/common/pref_names.h"
|
| #include "chrome/common/url_constants.h"
|
| @@ -49,7 +50,7 @@ class HostContentSettingsMapTest : public testing::Test {
|
| TEST_F(HostContentSettingsMapTest, DefaultValues) {
|
| TestingProfile profile;
|
| HostContentSettingsMap* host_content_settings_map =
|
| - profile.GetHostContentSettingsMap();
|
| + HostContentSettingsMapFactory::GetForProfile(&profile);
|
|
|
| // Check setting defaults.
|
| EXPECT_EQ(CONTENT_SETTING_ALLOW,
|
| @@ -92,7 +93,7 @@ TEST_F(HostContentSettingsMapTest, DefaultValues) {
|
| TEST_F(HostContentSettingsMapTest, IndividualSettings) {
|
| TestingProfile profile;
|
| HostContentSettingsMap* host_content_settings_map =
|
| - profile.GetHostContentSettingsMap();
|
| + HostContentSettingsMapFactory::GetForProfile(&profile);
|
|
|
| // Check returning individual settings.
|
| GURL host("http://example.com/");
|
| @@ -201,7 +202,7 @@ TEST_F(HostContentSettingsMapTest, IndividualSettings) {
|
| TEST_F(HostContentSettingsMapTest, Clear) {
|
| TestingProfile profile;
|
| HostContentSettingsMap* host_content_settings_map =
|
| - profile.GetHostContentSettingsMap();
|
| + HostContentSettingsMapFactory::GetForProfile(&profile);
|
|
|
| // Check clearing one type.
|
| ContentSettingsPattern pattern =
|
| @@ -248,7 +249,7 @@ TEST_F(HostContentSettingsMapTest, Clear) {
|
| TEST_F(HostContentSettingsMapTest, Patterns) {
|
| TestingProfile profile;
|
| HostContentSettingsMap* host_content_settings_map =
|
| - profile.GetHostContentSettingsMap();
|
| + HostContentSettingsMapFactory::GetForProfile(&profile);
|
|
|
| GURL host1("http://example.com/");
|
| GURL host2("http://www.example.com/");
|
| @@ -289,7 +290,7 @@ TEST_F(HostContentSettingsMapTest, Patterns) {
|
| TEST_F(HostContentSettingsMapTest, Observer) {
|
| TestingProfile profile;
|
| HostContentSettingsMap* host_content_settings_map =
|
| - profile.GetHostContentSettingsMap();
|
| + HostContentSettingsMapFactory::GetForProfile(&profile);
|
| MockSettingsObserver observer(host_content_settings_map);
|
|
|
| ContentSettingsPattern primary_pattern =
|
| @@ -330,7 +331,7 @@ TEST_F(HostContentSettingsMapTest, Observer) {
|
| TEST_F(HostContentSettingsMapTest, ObserveDefaultPref) {
|
| TestingProfile profile;
|
| HostContentSettingsMap* host_content_settings_map =
|
| - profile.GetHostContentSettingsMap();
|
| + HostContentSettingsMapFactory::GetForProfile(&profile);
|
|
|
| PrefService* prefs = profile.GetPrefs();
|
| GURL host("http://example.com");
|
| @@ -360,7 +361,7 @@ TEST_F(HostContentSettingsMapTest, ObserveDefaultPref) {
|
| TEST_F(HostContentSettingsMapTest, ObserveExceptionPref) {
|
| TestingProfile profile;
|
| HostContentSettingsMap* host_content_settings_map =
|
| - profile.GetHostContentSettingsMap();
|
| + HostContentSettingsMapFactory::GetForProfile(&profile);
|
|
|
| PrefService* prefs = profile.GetPrefs();
|
|
|
| @@ -410,7 +411,7 @@ TEST_F(HostContentSettingsMapTest, ObserveExceptionPref) {
|
| TEST_F(HostContentSettingsMapTest, HostTrimEndingDotCheck) {
|
| TestingProfile profile;
|
| HostContentSettingsMap* host_content_settings_map =
|
| - profile.GetHostContentSettingsMap();
|
| + HostContentSettingsMapFactory::GetForProfile(&profile);
|
| content_settings::CookieSettings* cookie_settings =
|
| CookieSettingsFactory::GetForProfile(&profile).get();
|
|
|
| @@ -565,7 +566,7 @@ TEST_F(HostContentSettingsMapTest, HostTrimEndingDotCheck) {
|
| TEST_F(HostContentSettingsMapTest, NestedSettings) {
|
| TestingProfile profile;
|
| HostContentSettingsMap* host_content_settings_map =
|
| - profile.GetHostContentSettingsMap();
|
| + HostContentSettingsMapFactory::GetForProfile(&profile);
|
|
|
| GURL host("http://a.b.example.com/");
|
| ContentSettingsPattern pattern1 =
|
| @@ -631,7 +632,7 @@ TEST_F(HostContentSettingsMapTest, NestedSettings) {
|
| TEST_F(HostContentSettingsMapTest, OffTheRecord) {
|
| TestingProfile profile;
|
| HostContentSettingsMap* host_content_settings_map =
|
| - profile.GetHostContentSettingsMap();
|
| + HostContentSettingsMapFactory::GetForProfile(&profile);
|
| scoped_refptr<HostContentSettingsMap> otr_map(
|
| new HostContentSettingsMap(profile.GetPrefs(),
|
| true));
|
| @@ -698,7 +699,7 @@ TEST_F(HostContentSettingsMapTest, CanonicalizeExceptionsUnicodeOnly) {
|
| dummy_payload);
|
| }
|
|
|
| - profile.GetHostContentSettingsMap();
|
| + HostContentSettingsMapFactory::GetForProfile(&profile);
|
|
|
| const base::DictionaryValue* all_settings_dictionary =
|
| prefs->GetDictionary(GetPrefName(CONTENT_SETTINGS_TYPE_PLUGINS));
|
| @@ -725,7 +726,7 @@ TEST_F(HostContentSettingsMapTest, CanonicalizeExceptionsUnicodeAndPunycode) {
|
| *puny_value);
|
|
|
| // Initialize the content map.
|
| - profile.GetHostContentSettingsMap();
|
| + HostContentSettingsMapFactory::GetForProfile(&profile);
|
|
|
| const base::DictionaryValue& content_setting_prefs =
|
| *profile.GetPrefs()->GetDictionary(
|
| @@ -741,7 +742,7 @@ TEST_F(HostContentSettingsMapTest, CanonicalizeExceptionsUnicodeAndPunycode) {
|
| TEST_F(HostContentSettingsMapTest, ManagedDefaultContentSetting) {
|
| TestingProfile profile;
|
| HostContentSettingsMap* host_content_settings_map =
|
| - profile.GetHostContentSettingsMap();
|
| + HostContentSettingsMapFactory::GetForProfile(&profile);
|
| TestingPrefServiceSyncable* prefs = profile.GetTestingPrefService();
|
|
|
| EXPECT_EQ(CONTENT_SETTING_ALLOW,
|
| @@ -779,7 +780,7 @@ TEST_F(HostContentSettingsMapTest,
|
| GetNonDefaultContentSettingsIfTypeManaged) {
|
| TestingProfile profile;
|
| HostContentSettingsMap* host_content_settings_map =
|
| - profile.GetHostContentSettingsMap();
|
| + HostContentSettingsMapFactory::GetForProfile(&profile);
|
| TestingPrefServiceSyncable* prefs = profile.GetTestingPrefService();
|
|
|
| // Set pattern for JavaScript setting.
|
| @@ -815,7 +816,7 @@ TEST_F(HostContentSettingsMapTest,
|
| ManagedDefaultContentSettingIgnoreUserPattern) {
|
| TestingProfile profile;
|
| HostContentSettingsMap* host_content_settings_map =
|
| - profile.GetHostContentSettingsMap();
|
| + HostContentSettingsMapFactory::GetForProfile(&profile);
|
| TestingPrefServiceSyncable* prefs = profile.GetTestingPrefService();
|
|
|
| // Block all JavaScript.
|
| @@ -860,7 +861,7 @@ TEST_F(HostContentSettingsMapTest,
|
| TEST_F(HostContentSettingsMapTest, OverwrittenDefaultContentSetting) {
|
| TestingProfile profile;
|
| HostContentSettingsMap* host_content_settings_map =
|
| - profile.GetHostContentSettingsMap();
|
| + HostContentSettingsMapFactory::GetForProfile(&profile);
|
| TestingPrefServiceSyncable* prefs = profile.GetTestingPrefService();
|
|
|
| // Set user defined default-content-setting for Cookies.
|
| @@ -890,7 +891,7 @@ TEST_F(HostContentSettingsMapTest, OverwrittenDefaultContentSetting) {
|
| TEST_F(HostContentSettingsMapTest, SettingDefaultContentSettingsWhenManaged) {
|
| TestingProfile profile;
|
| HostContentSettingsMap* host_content_settings_map =
|
| - profile.GetHostContentSettingsMap();
|
| + HostContentSettingsMapFactory::GetForProfile(&profile);
|
| TestingPrefServiceSyncable* prefs = profile.GetTestingPrefService();
|
|
|
| prefs->SetManagedPref(prefs::kManagedDefaultPluginsSetting,
|
| @@ -914,7 +915,7 @@ TEST_F(HostContentSettingsMapTest, SettingDefaultContentSettingsWhenManaged) {
|
| TEST_F(HostContentSettingsMapTest, GetContentSetting) {
|
| TestingProfile profile;
|
| HostContentSettingsMap* host_content_settings_map =
|
| - profile.GetHostContentSettingsMap();
|
| + HostContentSettingsMapFactory::GetForProfile(&profile);
|
|
|
| GURL host("http://example.com/");
|
| GURL embedder("chrome://foo");
|
| @@ -975,7 +976,7 @@ TEST_F(HostContentSettingsMapTest, IsSettingAllowedForType) {
|
| TEST_F(HostContentSettingsMapTest, AddContentSettingsObserver) {
|
| TestingProfile profile;
|
| HostContentSettingsMap* host_content_settings_map =
|
| - profile.GetHostContentSettingsMap();
|
| + HostContentSettingsMapFactory::GetForProfile(&profile);
|
| content_settings::MockObserver mock_observer;
|
|
|
| GURL host("http://example.com/");
|
|
|