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

Unified Diff: net/cookies/canonical_cookie_unittest.cc

Issue 1413623002: Convert 'CookieOptions::first_party_url' to a 'url::Origin'. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 years, 2 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 | « net/cookies/canonical_cookie.cc ('k') | net/cookies/cookie_monster.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cookies/canonical_cookie_unittest.cc
diff --git a/net/cookies/canonical_cookie_unittest.cc b/net/cookies/canonical_cookie_unittest.cc
index 9b10d13ff3b7036ae73d9c244fa9ce20b62145da..58c12ca656d447040152e9bcb9b612918f07d179 100644
--- a/net/cookies/canonical_cookie_unittest.cc
+++ b/net/cookies/canonical_cookie_unittest.cc
@@ -84,7 +84,7 @@ TEST(CanonicalCookieTest, Create) {
// Test creating http only cookies.
CookieOptions first_party_options;
- first_party_options.set_first_party_url(url);
+ first_party_options.set_first_party(url::Origin(url));
cookie.reset(CanonicalCookie::Create(url, "A=2; First-Party-Only",
creation_time, httponly_options));
EXPECT_TRUE(cookie.get());
@@ -351,26 +351,26 @@ TEST(CanonicalCookieTest, IncludeFirstPartyForFirstPartyURL) {
cookie.reset(CanonicalCookie::Create(secure_url, "A=2; First-Party-Only",
creation_time, options));
EXPECT_TRUE(cookie->IsFirstPartyOnly());
- options.set_first_party_url(GURL());
+ options.set_first_party(url::Origin());
EXPECT_FALSE(cookie->IncludeForRequestURL(secure_url, options));
// First-party-only cookies are included only if the cookie's origin matches
// the
// first-party origin.
- options.set_first_party_url(secure_url);
+ options.set_first_party(url::Origin(secure_url));
EXPECT_TRUE(cookie->IncludeForRequestURL(secure_url, options));
- options.set_first_party_url(insecure_url);
+ options.set_first_party(url::Origin(insecure_url));
EXPECT_FALSE(cookie->IncludeForRequestURL(secure_url, options));
- options.set_first_party_url(third_party_url);
+ options.set_first_party(url::Origin(third_party_url));
EXPECT_FALSE(cookie->IncludeForRequestURL(secure_url, options));
// "First-Party-Only" doesn't override the 'secure' flag.
cookie.reset(CanonicalCookie::Create(
secure_url, "A=2; Secure; First-Party-Only", creation_time, options));
- options.set_first_party_url(secure_url);
+ options.set_first_party(url::Origin(secure_url));
EXPECT_TRUE(cookie->IncludeForRequestURL(secure_url, options));
EXPECT_FALSE(cookie->IncludeForRequestURL(insecure_url, options));
- options.set_first_party_url(insecure_url);
+ options.set_first_party(url::Origin(insecure_url));
EXPECT_FALSE(cookie->IncludeForRequestURL(secure_url, options));
EXPECT_FALSE(cookie->IncludeForRequestURL(insecure_url, options));
@@ -378,10 +378,10 @@ TEST(CanonicalCookieTest, IncludeFirstPartyForFirstPartyURL) {
cookie.reset(CanonicalCookie::Create(secure_url_with_path,
"A=2; First-Party-Only; path=/foo/bar",
creation_time, options));
- options.set_first_party_url(secure_url_with_path);
+ options.set_first_party(url::Origin(secure_url_with_path));
EXPECT_TRUE(cookie->IncludeForRequestURL(secure_url_with_path, options));
EXPECT_FALSE(cookie->IncludeForRequestURL(secure_url, options));
- options.set_first_party_url(secure_url);
+ options.set_first_party(url::Origin(secure_url));
EXPECT_TRUE(cookie->IncludeForRequestURL(secure_url_with_path, options));
EXPECT_FALSE(cookie->IncludeForRequestURL(secure_url, options));
}
« no previous file with comments | « net/cookies/canonical_cookie.cc ('k') | net/cookies/cookie_monster.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698