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

Unified Diff: net/cookies/cookie_monster_unittest.cc

Issue 2882063002: Add a SetCanonicalCookie method for CookieMonster. (Closed)
Patch Set: Fix AW cookie store wrapper. Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/cookies/cookie_monster.cc ('k') | net/cookies/cookie_store.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cookies/cookie_monster_unittest.cc
diff --git a/net/cookies/cookie_monster_unittest.cc b/net/cookies/cookie_monster_unittest.cc
index 0b60812a4415f788f663da2d745ee87318b4dd2b..6878898f63df1b5b784b997fe0258e4248b39cd9 100644
--- a/net/cookies/cookie_monster_unittest.cc
+++ b/net/cookies/cookie_monster_unittest.cc
@@ -148,6 +148,20 @@ class CookieMonsterTestBase : public CookieStoreTest<T> {
return callback.result();
}
+ bool SetCanonicalCookie(std::unique_ptr<CookieMonster> cm,
+ std::unique_ptr<CanonicalCookie> cookie,
+ bool secure_source,
+ bool modify_http_only) {
+ DCHECK(cm);
+ ResultSavingCookieCallback<bool> callback;
+ cm->SetCanonicalCookieAsync(
+ std::move(cookie), secure_source, modify_http_only,
+ base::Bind(&ResultSavingCookieCallback<bool>::Run,
+ base::Unretained(&callback)));
+ callback.WaitUntilDone();
+ return callback.result();
+ }
+
int DeleteAllCreatedBetween(CookieMonster* cm,
const base::Time& delete_begin,
const base::Time& delete_end) {
@@ -2303,7 +2317,7 @@ TEST_F(CookieMonsterTest, WhileLoadingDeleteAllGetForURL) {
// When passed to the CookieMonster, it takes ownership of the pointed to
// cookies.
cookies.push_back(
- CanonicalCookie::Create(kUrl, "a=b", base::Time(), CookieOptions()));
+ CanonicalCookie::Create(kUrl, "a=b", base::Time::Now(), CookieOptions()));
ASSERT_TRUE(cookies[0]);
store->commands()[0].loaded_callback.Run(std::move(cookies));
« no previous file with comments | « net/cookies/cookie_monster.cc ('k') | net/cookies/cookie_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698