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

Unified Diff: net/cookies/cookie_monster_unittest.cc

Issue 2882063002: Add a SetCanonicalCookie method for CookieMonster. (Closed)
Patch Set: Fix iOS behavior for secure cookies. 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
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..a29b555f534e2195e0e70070d49d26b7e94fcec5 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(CookieMonster* cm,
+ CanonicalCookie cookie,
+ bool secure_source,
+ bool modify_http_only) {
+ DCHECK(cm);
+ ResultSavingCookieCallback<bool> callback;
+ cm->SetCanonicalCookieAsync(
+ 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()));
mmenke 2017/06/16 15:56:28 Why is this change needed in this CL?
Randy Smith (Not in Mondays) 2017/06/16 21:38:00 Because I added a DCHECK() in CanonicalCookie::Cre
ASSERT_TRUE(cookies[0]);
store->commands()[0].loaded_callback.Run(std::move(cookies));

Powered by Google App Engine
This is Rietveld 408576698