OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "net/cookies/cookie_monster_store_test.h" | 5 #include "net/cookies/cookie_monster_store_test.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 const base::Time& creation_time) { | 118 const base::Time& creation_time) { |
119 // Parse the cookie line. | 119 // Parse the cookie line. |
120 ParsedCookie pc(cookie_line); | 120 ParsedCookie pc(cookie_line); |
121 EXPECT_TRUE(pc.IsValid()); | 121 EXPECT_TRUE(pc.IsValid()); |
122 | 122 |
123 // This helper is simplistic in interpreting a parsed cookie, in order to | 123 // This helper is simplistic in interpreting a parsed cookie, in order to |
124 // avoid duplicated CookieMonster's CanonPath() and CanonExpiration() | 124 // avoid duplicated CookieMonster's CanonPath() and CanonExpiration() |
125 // functions. Would be nice to export them, and re-use here. | 125 // functions. Would be nice to export them, and re-use here. |
126 EXPECT_FALSE(pc.HasMaxAge()); | 126 EXPECT_FALSE(pc.HasMaxAge()); |
127 EXPECT_TRUE(pc.HasPath()); | 127 EXPECT_TRUE(pc.HasPath()); |
128 base::Time cookie_expires = pc.HasExpires() | 128 base::Time cookie_expires = |
129 ? cookie_util::ParseCookieTime(pc.Expires()) | 129 pc.HasExpires() ? cookie_util::ParseCookieExpirationTime(pc.Expires()) |
130 : base::Time(); | 130 : base::Time(); |
131 std::string cookie_path = pc.Path(); | 131 std::string cookie_path = pc.Path(); |
132 | 132 |
133 return CanonicalCookie::Create(url, pc.Name(), pc.Value(), url.host(), | 133 return CanonicalCookie::Create(url, pc.Name(), pc.Value(), url.host(), |
134 cookie_path, creation_time, cookie_expires, | 134 cookie_path, creation_time, cookie_expires, |
135 pc.IsSecure(), pc.IsHttpOnly(), pc.SameSite(), | 135 pc.IsSecure(), pc.IsHttpOnly(), pc.SameSite(), |
136 false, pc.Priority()); | 136 false, pc.Priority()); |
137 } | 137 } |
138 | 138 |
139 void AddCookieToList(const GURL& url, | 139 void AddCookieToList(const GURL& url, |
140 const std::string& cookie_line, | 140 const std::string& cookie_line, |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 store->AddCookie(*cc); | 243 store->AddCookie(*cc); |
244 } | 244 } |
245 | 245 |
246 return base::MakeUnique<CookieMonster>(store.get(), nullptr); | 246 return base::MakeUnique<CookieMonster>(store.get(), nullptr); |
247 } | 247 } |
248 | 248 |
249 MockSimplePersistentCookieStore::~MockSimplePersistentCookieStore() { | 249 MockSimplePersistentCookieStore::~MockSimplePersistentCookieStore() { |
250 } | 250 } |
251 | 251 |
252 } // namespace net | 252 } // namespace net |
OLD | NEW |