Commit 40df502a authored by jochen@chromium.org's avatar jochen@chromium.org

Don't register cookie access on empty cookie list.

BUG=none
TEST=TabSpecificContentSettingsTest.EmptyCookieList

Review URL: http://codereview.chromium.org/6352005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72009 0039d316-1c4b-4281-b951-d872f2087c98
parent 3b2db7a9
......@@ -107,6 +107,8 @@ void TabSpecificContentSettings::OnCookiesRead(
const GURL& url,
const net::CookieList& cookie_list,
bool blocked_by_policy) {
if (cookie_list.empty())
return;
LocalSharedObjectsContainer& container = blocked_by_policy ?
blocked_local_shared_objects_ : allowed_local_shared_objects_;
typedef net::CookieList::const_iterator cookie_iterator;
......
......@@ -5,7 +5,7 @@
#include "chrome/browser/tab_contents/tab_specific_content_settings.h"
#include "chrome/test/testing_profile.h"
#include "net/base/cookie_options.h"
#include "net/base/cookie_monster.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace {
......@@ -137,3 +137,20 @@ TEST(TabSpecificContentSettingsTest, AllowedContent) {
ASSERT_TRUE(
content_settings.IsContentBlocked(CONTENT_SETTINGS_TYPE_COOKIES));
}
TEST(TabSpecificContentSettingsTest, EmptyCookieList) {
TestContentSettingsDelegate test_delegate;
TestingProfile profile;
TabSpecificContentSettings content_settings(&test_delegate, &profile);
ASSERT_FALSE(
content_settings.IsContentAccessed(CONTENT_SETTINGS_TYPE_COOKIES));
ASSERT_FALSE(
content_settings.IsContentBlocked(CONTENT_SETTINGS_TYPE_COOKIES));
content_settings.OnCookiesRead(
GURL("http://google.com"), net::CookieList(), true);
ASSERT_FALSE(
content_settings.IsContentAccessed(CONTENT_SETTINGS_TYPE_COOKIES));
ASSERT_FALSE(
content_settings.IsContentBlocked(CONTENT_SETTINGS_TYPE_COOKIES));
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment