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

Unified Diff: headless/public/util/generic_url_request_job_test.cc

Issue 2861063003: Remove dangerous CanonicalCookie::Create method. (Closed)
Patch Set: Fixed bugs from DCHECKing name & path. Created 3 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
Index: headless/public/util/generic_url_request_job_test.cc
diff --git a/headless/public/util/generic_url_request_job_test.cc b/headless/public/util/generic_url_request_job_test.cc
index bb95a02c958242b6f2e6112287d4f6d27e9b0bae..daa12f1713eb6498312ca39de59c4429558c4615 100644
--- a/headless/public/util/generic_url_request_job_test.cc
+++ b/headless/public/util/generic_url_request_job_test.cc
@@ -367,56 +367,56 @@ TEST_F(GenericURLRequestJobTest, RequestWithCookies) {
// Basic matching cookie.
cookies->push_back(*net::CanonicalCookie::Create(
- GURL("https://example.com"), "basic_cookie", "1", "example.com", "/",
- base::Time(), base::Time(),
+ "basic_cookie", "1", ".example.com", "/", base::Time(), base::Time(),
+ base::Time(),
/* secure */ false,
/* http_only */ false, net::CookieSameSite::NO_RESTRICTION,
net::COOKIE_PRIORITY_DEFAULT));
// Matching secure cookie.
cookies->push_back(*net::CanonicalCookie::Create(
- GURL("https://example.com"), "secure_cookie", "2", "example.com", "/",
- base::Time(), base::Time(),
+ "secure_cookie", "2", ".example.com", "/", base::Time(), base::Time(),
+ base::Time(),
/* secure */ true,
/* http_only */ false, net::CookieSameSite::NO_RESTRICTION,
net::COOKIE_PRIORITY_DEFAULT));
// Matching http-only cookie.
cookies->push_back(*net::CanonicalCookie::Create(
- GURL("https://example.com"), "http_only_cookie", "3", "example.com", "/",
- base::Time(), base::Time(),
+ "http_only_cookie", "3", ".example.com", "/", base::Time(), base::Time(),
+ base::Time(),
/* secure */ false,
/* http_only */ true, net::CookieSameSite::NO_RESTRICTION,
net::COOKIE_PRIORITY_DEFAULT));
// Matching cookie with path.
cookies->push_back(*net::CanonicalCookie::Create(
- GURL("https://example.com"), "cookie_with_path", "4", "example.com",
- "/widgets", base::Time(), base::Time(),
+ "cookie_with_path", "4", ".example.com", "/widgets", base::Time(),
+ base::Time(), base::Time(),
/* secure */ false,
/* http_only */ false, net::CookieSameSite::NO_RESTRICTION,
net::COOKIE_PRIORITY_DEFAULT));
// Matching cookie with subdomain.
cookies->push_back(*net::CanonicalCookie::Create(
- GURL("https://cdn.example.com"), "bad_subdomain_cookie", "5",
- "cdn.example.com", "/", base::Time(), base::Time(),
+ "bad_subdomain_cookie", "5", ".cdn.example.com", "/", base::Time(),
+ base::Time(), base::Time(),
/* secure */ false,
/* http_only */ false, net::CookieSameSite::NO_RESTRICTION,
net::COOKIE_PRIORITY_DEFAULT));
// Non-matching cookie (different site).
cookies->push_back(*net::CanonicalCookie::Create(
- GURL("https://zombo.com"), "bad_site_cookie", "6", "zombo.com", "/",
- base::Time(), base::Time(),
+ "bad_site_cookie", "6", ".zombo.com", "/", base::Time(), base::Time(),
+ base::Time(),
/* secure */ false,
/* http_only */ false, net::CookieSameSite::NO_RESTRICTION,
net::COOKIE_PRIORITY_DEFAULT));
// Non-matching cookie (different path).
cookies->push_back(*net::CanonicalCookie::Create(
- GURL("https://example.com"), "bad_path_cookie", "7", "example.com",
- "/gadgets", base::Time(), base::Time(),
+ "bad_path_cookie", "7", "example.com", "/gadgets", base::Time(),
mmenke 2017/05/09 16:51:09 .example.com
Randy Smith (Not in Mondays) 2017/05/09 23:52:35 Done.
+ base::Time(), base::Time(),
/* secure */ false,
/* http_only */ false, net::CookieSameSite::NO_RESTRICTION,
net::COOKIE_PRIORITY_DEFAULT));

Powered by Google App Engine
This is Rietveld 408576698