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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
240 num_old_cookies = num_old_secure_cookies; | 240 num_old_cookies = num_old_secure_cookies; |
241 secure = true; | 241 secure = true; |
242 } else { | 242 } else { |
243 base = num_secure_cookies; | 243 base = num_secure_cookies; |
244 num_old_cookies = num_old_non_secure_cookies; | 244 num_old_cookies = num_old_non_secure_cookies; |
245 secure = false; | 245 secure = false; |
246 } | 246 } |
247 base::Time creation_time = | 247 base::Time creation_time = |
248 past_creation + base::TimeDelta::FromMicroseconds(i); | 248 past_creation + base::TimeDelta::FromMicroseconds(i); |
249 base::Time expiration_time = current + base::TimeDelta::FromDays(30); | 249 base::Time expiration_time = current + base::TimeDelta::FromDays(30); |
250 base::Time last_access_time = | |
251 ((i - base) < num_old_cookies) | |
252 ? current - base::TimeDelta::FromDays(days_old) | |
253 : current; | |
254 | 250 |
255 CanonicalCookie cc(GURL(), "a", "1", base::StringPrintf("h%05d.izzle", i), | 251 std::unique_ptr<CanonicalCookie> cc(CanonicalCookie::Create( |
256 "/path", creation_time, expiration_time, | 252 GURL(base::StringPrintf("http://h%05d.izzle/", i)), "a", "1", |
257 last_access_time, secure, false, | 253 std::string(), "/path", creation_time, expiration_time, secure, false, |
258 CookieSameSite::DEFAULT_MODE, COOKIE_PRIORITY_DEFAULT); | 254 CookieSameSite::DEFAULT_MODE, false, COOKIE_PRIORITY_DEFAULT)); |
mmenke
2016/06/03 12:00:06
Think you still need to set the last access date w
tfarina
2016/06/03 16:30:13
Awesome. Thanks Matt. This fixed it.
Done.
| |
259 store->AddCookie(cc); | 255 store->AddCookie(*cc); |
260 } | 256 } |
261 | 257 |
262 return base::WrapUnique(new CookieMonster(store.get(), nullptr)); | 258 return base::WrapUnique(new CookieMonster(store.get(), nullptr)); |
263 } | 259 } |
264 | 260 |
265 MockSimplePersistentCookieStore::~MockSimplePersistentCookieStore() { | 261 MockSimplePersistentCookieStore::~MockSimplePersistentCookieStore() { |
266 } | 262 } |
267 | 263 |
268 } // namespace net | 264 } // namespace net |
OLD | NEW |