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

Unified Diff: net/base/cookie_monster_unittest.cc

Issue 115204: Add a separate cookie store that's used for extensions.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 7 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
« net/base/cookie_monster.cc ('K') | « net/base/cookie_monster.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/cookie_monster_unittest.cc
===================================================================
--- net/base/cookie_monster_unittest.cc (revision 15945)
+++ net/base/cookie_monster_unittest.cc (working copy)
@@ -928,4 +928,21 @@
EXPECT_EQ("A=B; E=F", cm.GetCookies(url_google));
}
+TEST(CookieMonsterTest, SetCookieableSchemes) {
+ net::CookieMonster cm;
+ net::CookieMonster cm_foo;
+
+ // Only cm_foo should allow foo:// cookies.
+ const char* kSchemes[] = {"foo"};
+ cm_foo.SetCookieableSchemes(kSchemes, 1);
+
+ GURL foo_url("foo://host/path");
+ GURL http_url("http://host/path");
+
+ EXPECT_TRUE(cm.SetCookie(http_url, "x=1"));
+ EXPECT_FALSE(cm.SetCookie(foo_url, "x=1"));
+ EXPECT_TRUE(cm_foo.SetCookie(foo_url, "x=1"));
+ EXPECT_FALSE(cm_foo.SetCookie(http_url, "x=1"));
+}
+
// TODO test overwrite cookie
« net/base/cookie_monster.cc ('K') | « net/base/cookie_monster.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698