Chromium Code Reviews| Index: components/content_settings/core/test/content_settings_test_utils.cc |
| diff --git a/components/content_settings/core/test/content_settings_test_utils.cc b/components/content_settings/core/test/content_settings_test_utils.cc |
| index 87207195f02851e5e1be9073e4bb820b42c65eb3..116813f2c7bbfe5833090129797211fcf993bf9a 100644 |
| --- a/components/content_settings/core/test/content_settings_test_utils.cc |
| +++ b/components/content_settings/core/test/content_settings_test_utils.cc |
| @@ -4,7 +4,9 @@ |
| #include "components/content_settings/core/test/content_settings_test_utils.h" |
| +#include "components/content_settings/core/browser/content_settings_pref_provider.h" |
| #include "components/content_settings/core/browser/host_content_settings_map.h" |
| +#include "components/content_settings/core/common/content_settings_pattern.h" |
| #include "components/content_settings/core/common/content_settings_types.h" |
| namespace content_settings { |
| @@ -48,4 +50,16 @@ scoped_ptr<base::Value> TestUtils::GetContentSettingValueAndPatterns( |
| secondary_pattern); |
| } |
| +// static |
| +bool TestUtils::AddPrefException(const std::string& pattern_string, |
| + ContentSettingsType content_type, |
| + ContentSetting setting, |
| + HostContentSettingsMap* settings_map) { |
| + ContentSettingsPattern pattern = |
| + ContentSettingsPattern::FromString(pattern_string); |
| + base::Value* value = new base::FundamentalValue(setting); |
| + return settings_map->pref_provider_->SetWebsiteSetting( |
|
Bernhard Bauer
2016/04/07 09:11:08
Use an accessor. Also, why does this directly acce
huangs
2016/04/07 21:44:07
An accessor invites usage, but currently direct ac
Bernhard Bauer
2016/04/08 14:44:35
I still think you could go through HCSM, no?
huangs
2016/04/11 19:01:03
Don't know what you mean; in the latest version I
|
| + pattern, pattern, content_type, std::string(), value); |
| +} |
| + |
| } // namespace content_settings |