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

Unified Diff: chrome/browser/tab_contents/tab_specific_content_settings_unittest.cc

Issue 3194005: Clear cookie related settings at the beginning of a navigation instead of at the end. (Closed)
Patch Set: Created 10 years, 4 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
« no previous file with comments | « chrome/browser/tab_contents/tab_specific_content_settings.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tab_contents/tab_specific_content_settings_unittest.cc
diff --git a/chrome/browser/tab_contents/tab_specific_content_settings_unittest.cc b/chrome/browser/tab_contents/tab_specific_content_settings_unittest.cc
index 6129f7dc3af8275bbdac02a235e0e7553b859058..dd325c75f379c3a32e4229cec3b1d6fc848eb41f 100644
--- a/chrome/browser/tab_contents/tab_specific_content_settings_unittest.cc
+++ b/chrome/browser/tab_contents/tab_specific_content_settings_unittest.cc
@@ -73,9 +73,27 @@ TEST(TabSpecificContentSettingsTest, BlockedContent) {
EXPECT_FALSE(
content_settings.IsContentBlocked(CONTENT_SETTINGS_TYPE_COOKIES));
EXPECT_TRUE(content_settings.IsContentBlocked(CONTENT_SETTINGS_TYPE_POPUPS));
+ content_settings.OnCookieAccessed(GURL("http://google.com"), "A=B", false);
+
+ // Block a cookie.
+ content_settings.OnCookieAccessed(GURL("http://google.com"), "C=D", true);
+ EXPECT_TRUE(
+ content_settings.IsContentBlocked(CONTENT_SETTINGS_TYPE_COOKIES));
// Reset blocked content settings.
- content_settings.ClearBlockedContentSettings();
+ content_settings.ClearBlockedContentSettingsExceptForCookies();
+ EXPECT_TRUE(test_delegate.SettingsChanged());
+ EXPECT_FALSE(test_delegate.ContentBlocked());
+ EXPECT_FALSE(content_settings.IsContentBlocked(CONTENT_SETTINGS_TYPE_IMAGES));
+ EXPECT_FALSE(
+ content_settings.IsContentBlocked(CONTENT_SETTINGS_TYPE_JAVASCRIPT));
+ EXPECT_FALSE(
+ content_settings.IsContentBlocked(CONTENT_SETTINGS_TYPE_PLUGINS));
+ EXPECT_TRUE(
+ content_settings.IsContentBlocked(CONTENT_SETTINGS_TYPE_COOKIES));
+ EXPECT_FALSE(content_settings.IsContentBlocked(CONTENT_SETTINGS_TYPE_POPUPS));
+
+ content_settings.ClearCookieSpecificContentSettings();
EXPECT_TRUE(test_delegate.SettingsChanged());
EXPECT_FALSE(test_delegate.ContentBlocked());
EXPECT_FALSE(content_settings.IsContentBlocked(CONTENT_SETTINGS_TYPE_IMAGES));
« no previous file with comments | « chrome/browser/tab_contents/tab_specific_content_settings.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698