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

Side by Side Diff: chrome/browser/tab_contents/tab_specific_content_settings_unittest.cc

Issue 6352005: Don't register cookie access on empty cookie list. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome/browser/tab_contents
Patch Set: Created 9 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/tab_contents/tab_specific_content_settings.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/tab_contents/tab_specific_content_settings.h" 5 #include "chrome/browser/tab_contents/tab_specific_content_settings.h"
6 6
7 #include "chrome/test/testing_profile.h" 7 #include "chrome/test/testing_profile.h"
8 #include "net/base/cookie_options.h" 8 #include "net/base/cookie_monster.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
11 namespace { 11 namespace {
12 class TestContentSettingsDelegate 12 class TestContentSettingsDelegate
13 : public TabSpecificContentSettings::Delegate { 13 : public TabSpecificContentSettings::Delegate {
14 public: 14 public:
15 TestContentSettingsDelegate() 15 TestContentSettingsDelegate()
16 : settings_changed_(false), content_blocked_(false) {} 16 : settings_changed_(false), content_blocked_(false) {}
17 virtual ~TestContentSettingsDelegate() {} 17 virtual ~TestContentSettingsDelegate() {}
18 18
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 content_settings.IsContentAccessed(CONTENT_SETTINGS_TYPE_COOKIES)); 130 content_settings.IsContentAccessed(CONTENT_SETTINGS_TYPE_COOKIES));
131 ASSERT_FALSE( 131 ASSERT_FALSE(
132 content_settings.IsContentBlocked(CONTENT_SETTINGS_TYPE_COOKIES)); 132 content_settings.IsContentBlocked(CONTENT_SETTINGS_TYPE_COOKIES));
133 content_settings.OnCookieChanged( 133 content_settings.OnCookieChanged(
134 GURL("http://google.com"), "C=D", options, true); 134 GURL("http://google.com"), "C=D", options, true);
135 ASSERT_TRUE( 135 ASSERT_TRUE(
136 content_settings.IsContentAccessed(CONTENT_SETTINGS_TYPE_COOKIES)); 136 content_settings.IsContentAccessed(CONTENT_SETTINGS_TYPE_COOKIES));
137 ASSERT_TRUE( 137 ASSERT_TRUE(
138 content_settings.IsContentBlocked(CONTENT_SETTINGS_TYPE_COOKIES)); 138 content_settings.IsContentBlocked(CONTENT_SETTINGS_TYPE_COOKIES));
139 } 139 }
140
141 TEST(TabSpecificContentSettingsTest, EmptyCookieList) {
142 TestContentSettingsDelegate test_delegate;
143 TestingProfile profile;
144 TabSpecificContentSettings content_settings(&test_delegate, &profile);
145
146 ASSERT_FALSE(
147 content_settings.IsContentAccessed(CONTENT_SETTINGS_TYPE_COOKIES));
148 ASSERT_FALSE(
149 content_settings.IsContentBlocked(CONTENT_SETTINGS_TYPE_COOKIES));
150 content_settings.OnCookiesRead(
151 GURL("http://google.com"), net::CookieList(), true);
152 ASSERT_FALSE(
153 content_settings.IsContentAccessed(CONTENT_SETTINGS_TYPE_COOKIES));
154 ASSERT_FALSE(
155 content_settings.IsContentBlocked(CONTENT_SETTINGS_TYPE_COOKIES));
156 }
OLDNEW
« 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