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

Side by Side Diff: net/cookies/cookie_monster_store_test.cc

Issue 2030233002: net: migrate CreateMonsterFromStoreForGC() to CanonicalCookies::Create method - WIP (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix GarbageCollectionTriggers test Created 4 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 = 250 base::Time last_access_time =
251 ((i - base) < num_old_cookies) 251 ((i - base) < num_old_cookies)
252 ? current - base::TimeDelta::FromDays(days_old) 252 ? current - base::TimeDelta::FromDays(days_old)
253 : current; 253 : current;
254 254
255 CanonicalCookie cc(GURL(), "a", "1", base::StringPrintf("h%05d.izzle", i), 255 std::unique_ptr<CanonicalCookie> cc(CanonicalCookie::Create(
256 "/path", creation_time, expiration_time, 256 GURL(base::StringPrintf("http://h%05d.izzle/", i)), "a", "1",
257 last_access_time, secure, false, 257 std::string(), "/path", creation_time, expiration_time, secure, false,
258 CookieSameSite::DEFAULT_MODE, COOKIE_PRIORITY_DEFAULT); 258 CookieSameSite::DEFAULT_MODE, false, COOKIE_PRIORITY_DEFAULT));
259 store->AddCookie(cc); 259 cc->SetLastAccessDate(last_access_time);
260 store->AddCookie(*cc);
260 } 261 }
261 262
262 return base::WrapUnique(new CookieMonster(store.get(), nullptr)); 263 return base::WrapUnique(new CookieMonster(store.get(), nullptr));
263 } 264 }
264 265
265 MockSimplePersistentCookieStore::~MockSimplePersistentCookieStore() { 266 MockSimplePersistentCookieStore::~MockSimplePersistentCookieStore() {
266 } 267 }
267 268
268 } // namespace net 269 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698