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

Unified Diff: chrome/browser/extensions/api/cookies/cookies_unittest.cc

Issue 876973003: Implement the "first-party-only" cookie flag. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: FirstPartyOnly. Created 5 years, 10 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/api/cookies/cookies_unittest.cc
diff --git a/chrome/browser/extensions/api/cookies/cookies_unittest.cc b/chrome/browser/extensions/api/cookies/cookies_unittest.cc
index e578df2bbc09bdac3065fceea70125afbfa0fa95..cbb4cc2e355f540c4f4f0e605e463a0062fa76f0 100644
--- a/chrome/browser/extensions/api/cookies/cookies_unittest.cc
+++ b/chrome/browser/extensions/api/cookies/cookies_unittest.cc
@@ -81,9 +81,8 @@ TEST_F(ExtensionCookiesTest, StoreIdProfileConversion) {
TEST_F(ExtensionCookiesTest, ExtensionTypeCreation) {
net::CanonicalCookie canonical_cookie1(
- GURL(), "ABC", "DEF", "www.foobar.com", "/",
- base::Time(), base::Time(), base::Time(),
- false, false, net::COOKIE_PRIORITY_DEFAULT);
+ GURL(), "ABC", "DEF", "www.foobar.com", "/", base::Time(), base::Time(),
+ base::Time(), false, false, false, net::COOKIE_PRIORITY_DEFAULT);
scoped_ptr<Cookie> cookie1(
cookies_helpers::CreateCookie(
canonical_cookie1, "some cookie store"));
@@ -99,9 +98,9 @@ TEST_F(ExtensionCookiesTest, ExtensionTypeCreation) {
EXPECT_EQ("some cookie store", cookie1->store_id);
net::CanonicalCookie canonical_cookie2(
- GURL(), "ABC", "DEF", ".foobar.com", "/",
- base::Time(), base::Time::FromDoubleT(10000), base::Time(),
- false, false, net::COOKIE_PRIORITY_DEFAULT);
+ GURL(), "ABC", "DEF", ".foobar.com", "/", base::Time(),
+ base::Time::FromDoubleT(10000), base::Time(), false, false, false,
+ net::COOKIE_PRIORITY_DEFAULT);
scoped_ptr<Cookie> cookie2(
cookies_helpers::CreateCookie(
canonical_cookie2, "some cookie store"));
@@ -120,16 +119,16 @@ TEST_F(ExtensionCookiesTest, ExtensionTypeCreation) {
}
TEST_F(ExtensionCookiesTest, GetURLFromCanonicalCookie) {
- net::CanonicalCookie cookie1(
- GURL(), "ABC", "DEF", "www.foobar.com", "/", base::Time(), base::Time(),
- base::Time(), false, false, net::COOKIE_PRIORITY_DEFAULT);
+ net::CanonicalCookie cookie1(GURL(), "ABC", "DEF", "www.foobar.com", "/",
+ base::Time(), base::Time(), base::Time(), false,
+ false, false, net::COOKIE_PRIORITY_DEFAULT);
EXPECT_EQ("http://www.foobar.com/",
cookies_helpers::GetURLFromCanonicalCookie(
cookie1).spec());
- net::CanonicalCookie cookie2(
- GURL(), "ABC", "DEF", ".helloworld.com", "/", base::Time(), base::Time(),
- base::Time(), true, false, net::COOKIE_PRIORITY_DEFAULT);
+ net::CanonicalCookie cookie2(GURL(), "ABC", "DEF", ".helloworld.com", "/",
+ base::Time(), base::Time(), base::Time(), true,
+ false, false, net::COOKIE_PRIORITY_DEFAULT);
EXPECT_EQ("https://helloworld.com/",
cookies_helpers::GetURLFromCanonicalCookie(
cookie2).spec());
@@ -165,33 +164,19 @@ TEST_F(ExtensionCookiesTest, DomainMatching) {
scoped_ptr<GetAll::Params> params(GetAll::Params::Create(args));
cookies_helpers::MatchFilter filter(&params->details);
- net::CanonicalCookie cookie(GURL(),
- std::string(),
- std::string(),
- tests[i].domain,
- std::string(),
- base::Time(),
- base::Time(),
- base::Time(),
- false,
- false,
+ net::CanonicalCookie cookie(GURL(), std::string(), std::string(),
+ tests[i].domain, std::string(), base::Time(),
+ base::Time(), base::Time(), false, false, false,
net::COOKIE_PRIORITY_DEFAULT);
EXPECT_EQ(tests[i].matches, filter.MatchesCookie(cookie));
}
}
TEST_F(ExtensionCookiesTest, DecodeUTF8WithErrorHandling) {
- net::CanonicalCookie canonical_cookie(GURL(),
- std::string(),
- "011Q255bNX_1!yd\203e+",
- "test.com",
- "/path\203",
- base::Time(),
- base::Time(),
- base::Time(),
- false,
- false,
- net::COOKIE_PRIORITY_DEFAULT);
+ net::CanonicalCookie canonical_cookie(
+ GURL(), std::string(), "011Q255bNX_1!yd\203e+", "test.com", "/path\203",
+ base::Time(), base::Time(), base::Time(), false, false, false,
+ net::COOKIE_PRIORITY_DEFAULT);
scoped_ptr<Cookie> cookie(
cookies_helpers::CreateCookie(
canonical_cookie, "some cookie store"));
« no previous file with comments | « chrome/browser/extensions/api/cookies/cookies_api.cc ('k') | content/browser/net/sqlite_persistent_cookie_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698