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

Unified Diff: chrome/browser/browsing_data/browsing_data_cookie_helper_unittest.cc

Issue 12546016: Remove the Extensions URLRequestContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: most unittests pass Created 7 years, 5 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: chrome/browser/browsing_data/browsing_data_cookie_helper_unittest.cc
diff --git a/chrome/browser/browsing_data/browsing_data_cookie_helper_unittest.cc b/chrome/browser/browsing_data/browsing_data_cookie_helper_unittest.cc
index 7e02b8352514912eb78b27ffe250f0363abce969..eeb64e1fc5b79916a29dee8331b7f2ca9486b47f 100644
--- a/chrome/browser/browsing_data/browsing_data_cookie_helper_unittest.cc
+++ b/chrome/browser/browsing_data/browsing_data_cookie_helper_unittest.cc
@@ -7,6 +7,9 @@
#include "base/bind.h"
#include "base/run_loop.h"
#include "chrome/test/base/testing_profile.h"
+#include "content/public/browser/cookie_store_map.h"
+#include "content/public/browser/storage_partition.h"
+#include "content/public/common/url_constants.h"
#include "content/public/test/test_browser_thread_bundle.h"
#include "net/cookies/canonical_cookie.h"
#include "net/cookies/parsed_cookie.h"
@@ -21,9 +24,18 @@ class BrowsingDataCookieHelperTest : public testing::Test {
: testing_profile_(new TestingProfile()) {
}
+ net::CookieMonster* GetHttpCookieMonster() {
+ using content::BrowserContext;
+ // Since it's a unittest, assume default StoragePartition.
+ const content::CookieStoreMap& cookie_store_map =
+ BrowserContext::GetDefaultStoragePartition(testing_profile_.get())->
+ GetCookieStoreMap();
+ return cookie_store_map.GetForScheme(chrome::kHttpScheme)->
+ GetCookieMonster();
+ }
+
void CreateCookiesForTest() {
- scoped_refptr<net::CookieMonster> cookie_monster =
- testing_profile_->GetCookieMonster();
+ scoped_refptr<net::CookieMonster> cookie_monster = GetHttpCookieMonster();
cookie_monster->SetCookieWithOptionsAsync(
GURL("http://www.google.com"), "A=1", net::CookieOptions(),
net::CookieMonster::SetCookiesCallback());
@@ -33,8 +45,7 @@ class BrowsingDataCookieHelperTest : public testing::Test {
}
void CreateCookiesForDomainCookieTest() {
- scoped_refptr<net::CookieMonster> cookie_monster =
- testing_profile_->GetCookieMonster();
+ scoped_refptr<net::CookieMonster> cookie_monster = GetHttpCookieMonster();
cookie_monster->SetCookieWithOptionsAsync(
GURL("http://www.google.com"), "A=1", net::CookieOptions(),
net::CookieMonster::SetCookiesCallback());

Powered by Google App Engine
This is Rietveld 408576698