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

Unified Diff: ios/net/cookies/system_cookie_util_unittest.mm

Issue 2159373002: net: make CanonicalCookie's constructor private (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 5 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: ios/net/cookies/system_cookie_util_unittest.mm
diff --git a/ios/net/cookies/system_cookie_util_unittest.mm b/ios/net/cookies/system_cookie_util_unittest.mm
index ddca58306cbbf85f099075e314be8b7dfef64b8a..17ae8c7ba884dba64dd5db9cc14d52df8bb54ad4 100644
--- a/ios/net/cookies/system_cookie_util_unittest.mm
+++ b/ios/net/cookies/system_cookie_util_unittest.mm
@@ -18,6 +18,7 @@ namespace net {
namespace {
+const char kCookieURL[] = "http://example.com";
const char kCookieDomain[] = "domain";
const char kCookieName[] = "name";
const char kCookiePath[] = "path/";
@@ -26,12 +27,10 @@ const char kCookieValueInvalidUtf8[] = "\x81r\xe4\xbd\xa0\xe5\xa5\xbd";
void CheckSystemCookie(const base::Time& expires, bool secure, bool httponly) {
// Generate a canonical cookie.
- net::CanonicalCookie canonical_cookie = net::CanonicalCookie(
- GURL(), kCookieName, kCookieValue, kCookieDomain, kCookiePath,
+ net::CanonicalCookie canonical_cookie = *net::CanonicalCookie::Create(
+ GURL(kCookieURL), kCookieName, kCookieValue, std::string(), kCookiePath,
base::Time(), // creation
- expires,
- base::Time(), // last_access
- secure, httponly, net::CookieSameSite::DEFAULT_MODE,
+ expires, secure, httponly, net::CookieSameSite::DEFAULT_MODE, false,
net::COOKIE_PRIORITY_DEFAULT);
// Convert it to system cookie.
base::scoped_nsobject<NSHTTPCookie> system_cookie(
@@ -116,14 +115,14 @@ TEST(CookieUtil, SystemCookieFromCanonicalCookie) {
TEST(CookieUtil, SystemCookieFromBadCanonicalCookie) {
// Generate a bad canonical cookie (value is invalid utf8).
- net::CanonicalCookie bad_canonical_cookie = net::CanonicalCookie(
- GURL(), kCookieName, kCookieValueInvalidUtf8, kCookieDomain, kCookiePath,
+ net::CanonicalCookie bad_canonical_cookie = *net::CanonicalCookie::Create(
+ GURL(kCookieURL), kCookieName, kCookieValueInvalidUtf8, std::string(),
+ kCookiePath,
base::Time(), // creation
base::Time(), // expires
- base::Time(), // last_access
false, // secure
false, // httponly
- net::CookieSameSite::DEFAULT_MODE, net::COOKIE_PRIORITY_DEFAULT);
+ net::CookieSameSite::DEFAULT_MODE, false, net::COOKIE_PRIORITY_DEFAULT);
// Convert it to system cookie.
base::scoped_nsobject<NSHTTPCookie> system_cookie(
[SystemCookieFromCanonicalCookie(bad_canonical_cookie) retain]);

Powered by Google App Engine
This is Rietveld 408576698