Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1664)

Unified Diff: chrome/browser/extensions/extension_special_storage_policy_unittest.cc

Issue 8383004: Adding CookieSettings for storing cookie content settings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing the rebase. Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/extension_special_storage_policy_unittest.cc
diff --git a/chrome/browser/extensions/extension_special_storage_policy_unittest.cc b/chrome/browser/extensions/extension_special_storage_policy_unittest.cc
index 938b3f9d45e38e6526e1fcaff685082c174c8e4e..892d925ecc20410883b5c9fb6e03d9f586f4899a 100644
--- a/chrome/browser/extensions/extension_special_storage_policy_unittest.cc
+++ b/chrome/browser/extensions/extension_special_storage_policy_unittest.cc
@@ -3,7 +3,7 @@
// found in the LICENSE file.
#include "base/values.h"
-#include "chrome/browser/content_settings/host_content_settings_map.h"
+#include "chrome/browser/content_settings/cookie_settings.h"
#include "chrome/browser/extensions/extension_special_storage_policy.h"
#include "chrome/common/content_settings.h"
#include "chrome/common/content_settings_types.h"
@@ -220,36 +220,32 @@ TEST_F(ExtensionSpecialStoragePolicyTest, HasSessionOnlyOrigins) {
BrowserThread ui_thread(BrowserThread::UI, &message_loop);
TestingProfile profile;
- HostContentSettingsMap* host_content_settings_map =
- profile.GetHostContentSettingsMap();
+ CookieSettings* cookie_settings = CookieSettings::GetForProfile(&profile);
scoped_refptr<ExtensionSpecialStoragePolicy> policy(
- new ExtensionSpecialStoragePolicy(host_content_settings_map));
+ new ExtensionSpecialStoragePolicy(cookie_settings));
EXPECT_FALSE(policy->HasSessionOnlyOrigins());
// The default setting can be session-only.
- host_content_settings_map->SetDefaultContentSetting(
- CONTENT_SETTINGS_TYPE_COOKIES, CONTENT_SETTING_SESSION_ONLY);
+ cookie_settings->SetDefaultCookieSetting(CONTENT_SETTING_SESSION_ONLY);
EXPECT_TRUE(policy->HasSessionOnlyOrigins());
- host_content_settings_map->SetDefaultContentSetting(
- CONTENT_SETTINGS_TYPE_COOKIES, CONTENT_SETTING_ALLOW);
+ cookie_settings->SetDefaultCookieSetting(CONTENT_SETTING_ALLOW);
EXPECT_FALSE(policy->HasSessionOnlyOrigins());
// Or the session-onlyness can affect individual origins.
ContentSettingsPattern pattern =
ContentSettingsPattern::FromString("pattern.com");
- host_content_settings_map->SetContentSetting(
- pattern, ContentSettingsPattern::Wildcard(),
- CONTENT_SETTINGS_TYPE_COOKIES, "", CONTENT_SETTING_SESSION_ONLY);
+ cookie_settings->SetCookieSetting(pattern,
+ ContentSettingsPattern::Wildcard(),
+ CONTENT_SETTING_SESSION_ONLY);
EXPECT_TRUE(policy->HasSessionOnlyOrigins());
// Clearing an origin-spesific rule.
- host_content_settings_map->SetContentSetting(
- pattern, ContentSettingsPattern::Wildcard(),
- CONTENT_SETTINGS_TYPE_COOKIES, "", CONTENT_SETTING_DEFAULT);
+ cookie_settings->ResetCookieSetting(pattern,
+ ContentSettingsPattern::Wildcard());
EXPECT_FALSE(policy->HasSessionOnlyOrigins());
}
« no previous file with comments | « chrome/browser/extensions/extension_special_storage_policy.cc ('k') | chrome/browser/net/cookie_policy_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698