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

Side by Side Diff: ios/net/cookies/cookie_cache_unittest.cc

Issue 1773133002: SameSite: Implement 'Strict'/'Lax' attribute parsing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: mmenke@ Created 4 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ios/net/cookies/cookie_cache.h" 5 #include "ios/net/cookies/cookie_cache.h"
6 6
7 #include "net/cookies/canonical_cookie.h" 7 #include "net/cookies/canonical_cookie.h"
8 #include "net/cookies/cookie_constants.h" 8 #include "net/cookies/cookie_constants.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
11 namespace net { 11 namespace net {
12 12
13 using net::CanonicalCookie; 13 using net::CanonicalCookie;
14 14
15 namespace { 15 namespace {
16 16
17 CanonicalCookie MakeCookie(const GURL& url, 17 CanonicalCookie MakeCookie(const GURL& url,
18 const std::string& name, 18 const std::string& name,
19 const std::string& value) { 19 const std::string& value) {
20 return CanonicalCookie(url, name, value, url.host(), url.path(), base::Time(), 20 return CanonicalCookie(url, name, value, url.host(), url.path(), base::Time(),
21 base::Time(), base::Time(), false, false, false, 21 base::Time(), base::Time(), false, false,
22 net::CookieSameSite::DEFAULT_MODE,
22 net::COOKIE_PRIORITY_DEFAULT); 23 net::COOKIE_PRIORITY_DEFAULT);
23 } 24 }
24 25
25 } // namespace 26 } // namespace
26 27
27 TEST(CookieCacheTest, UpdateAddsCookieAllowsnullptr) { 28 TEST(CookieCacheTest, UpdateAddsCookieAllowsnullptr) {
28 CookieCache cache; 29 CookieCache cache;
29 const GURL test_url("http://www.google.com"); 30 const GURL test_url("http://www.google.com");
30 std::vector<CanonicalCookie> cookies; 31 std::vector<CanonicalCookie> cookies;
31 cookies.push_back(MakeCookie(test_url, "abc", "def")); 32 cookies.push_back(MakeCookie(test_url, "abc", "def"));
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 EXPECT_TRUE(cache.Update(cookieurl, "abc", cookies, nullptr, nullptr)); 160 EXPECT_TRUE(cache.Update(cookieurl, "abc", cookies, nullptr, nullptr));
160 EXPECT_FALSE(cache.Update(cookieurl, "abc", cookies, nullptr, nullptr)); 161 EXPECT_FALSE(cache.Update(cookieurl, "abc", cookies, nullptr, nullptr));
161 cookies[0] = MakeCookie(cookieurl, "def", "def"); 162 cookies[0] = MakeCookie(cookieurl, "def", "def");
162 EXPECT_TRUE(cache.Update(cookieurl, "def", cookies, nullptr, nullptr)); 163 EXPECT_TRUE(cache.Update(cookieurl, "def", cookies, nullptr, nullptr));
163 EXPECT_FALSE(cache.Update(cookieurl, "def", cookies, nullptr, nullptr)); 164 EXPECT_FALSE(cache.Update(cookieurl, "def", cookies, nullptr, nullptr));
164 cookies[0] = MakeCookie(cookieurl, "abc", "def"); 165 cookies[0] = MakeCookie(cookieurl, "abc", "def");
165 EXPECT_FALSE(cache.Update(cookieurl, "abc", cookies, nullptr, nullptr)); 166 EXPECT_FALSE(cache.Update(cookieurl, "abc", cookies, nullptr, nullptr));
166 } 167 }
167 168
168 } // namespace net 169 } // namespace net
OLDNEW
« no previous file with comments | « content/browser/net/quota_policy_cookie_store_unittest.cc ('k') | ios/net/cookies/cookie_store_ios.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698