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

Unified Diff: net/cookies/cookie_monster_unittest.cc

Issue 1602283002: Convert some raw CanonicalCookie ptrs to scoped_ptr<CanonicalCookie>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix missed CanonicalCookie::Create() callsite in ios/net/cookies/cookie_store_ios_unittest.mm Created 4 years, 11 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') | no next file » | 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 efeadd96d5855e84caf83a96005b059d9249e8cb..4097dfe85c9eaa3efa23ef0e0766da928692608a 100644
--- a/net/cookies/cookie_monster_unittest.cc
+++ b/net/cookies/cookie_monster_unittest.cc
@@ -2820,11 +2820,11 @@ TEST_F(MultiThreadedCookieMonsterTest, ThreadCheckDeleteCanonicalCookie) {
// MultiThreadedCookieMonsterTest in order to test and use
// GetAllCookiesForURLAsync, but it does not use any additional threads.
TEST_F(MultiThreadedCookieMonsterTest, GetAllCookiesForURLEffectiveDomain) {
- std::vector<CanonicalCookie*> cookies;
- // This cookie will be freed by the CookieMonster.
- cookies.push_back(CanonicalCookie::Create(
+ scoped_ptr<CanonicalCookie> cookie(CanonicalCookie::Create(
http_www_google_.url(), kValidCookieLine, Time::Now(), CookieOptions()));
- CanonicalCookie cookie = *cookies[0];
+
+ // This cookie will be freed by the CookieMonster.
+ std::vector<CanonicalCookie*> cookies = {new CanonicalCookie(*cookie)};
scoped_refptr<NewMockPersistentCookieStore> store(
new NewMockPersistentCookieStore);
scoped_refptr<CookieMonster> cm(new CookieMonster(store.get(), NULL));
@@ -2856,7 +2856,7 @@ TEST_F(MultiThreadedCookieMonsterTest, GetAllCookiesForURLEffectiveDomain) {
ASSERT_TRUE(callback.did_run());
// See that the callback was called with the cookies.
ASSERT_EQ(1u, callback.cookies().size());
- EXPECT_TRUE(cookie.IsEquivalent(callback.cookies()[0]));
+ EXPECT_TRUE(cookie->IsEquivalent(callback.cookies()[0]));
// All urls in |urls| should share the same cookie domain.
const GURL kUrls[] = {
@@ -2870,7 +2870,7 @@ TEST_F(MultiThreadedCookieMonsterTest, GetAllCookiesForURLEffectiveDomain) {
GetAllCookiesForURLTask(cm.get(), url, &callback);
ASSERT_TRUE(callback.did_run());
ASSERT_EQ(1u, callback.cookies().size());
- EXPECT_TRUE(cookie.IsEquivalent(callback.cookies()[0]));
+ EXPECT_TRUE(cookie->IsEquivalent(callback.cookies()[0]));
}
}
« no previous file with comments | « net/cookies/cookie_monster.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698