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

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

Issue 23551005: Revert 219709 "Remove the Extensions URLRequestContext." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 4 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: trunk/src/chrome/browser/browsing_data/browsing_data_cookie_helper_unittest.cc
===================================================================
--- trunk/src/chrome/browser/browsing_data/browsing_data_cookie_helper_unittest.cc (revision 219785)
+++ trunk/src/chrome/browser/browsing_data/browsing_data_cookie_helper_unittest.cc (working copy)
@@ -7,8 +7,6 @@
#include "base/bind.h"
#include "base/run_loop.h"
#include "chrome/test/base/testing_profile.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"
@@ -23,32 +21,25 @@
: testing_profile_(new TestingProfile()) {
}
- net::CookieMonster* GetCookieMonster(const GURL& origin) {
- using content::BrowserContext;
- // Since it's a unittest, assume default StoragePartition.
- return BrowserContext::GetDefaultStoragePartition(testing_profile_.get())->
- GetCookieStoreForScheme(origin.scheme())->GetCookieMonster();
- }
-
void CreateCookiesForTest() {
- GURL origin1("http://www.google.com");
- GURL origin2("http://www.gmail.google.com");
- GetCookieMonster(origin1)->SetCookieWithOptionsAsync(
- origin1, "A=1", net::CookieOptions(),
+ scoped_refptr<net::CookieMonster> cookie_monster =
+ testing_profile_->GetCookieMonster();
+ cookie_monster->SetCookieWithOptionsAsync(
+ GURL("http://www.google.com"), "A=1", net::CookieOptions(),
net::CookieMonster::SetCookiesCallback());
- GetCookieMonster(origin2)->SetCookieWithOptionsAsync(
- origin2, "B=1", net::CookieOptions(),
+ cookie_monster->SetCookieWithOptionsAsync(
+ GURL("http://www.gmail.google.com"), "B=1", net::CookieOptions(),
net::CookieMonster::SetCookiesCallback());
}
void CreateCookiesForDomainCookieTest() {
- GURL origin("http://www.google.com");
- scoped_refptr<net::CookieMonster> cookie_monster = GetCookieMonster(origin);
+ scoped_refptr<net::CookieMonster> cookie_monster =
+ testing_profile_->GetCookieMonster();
cookie_monster->SetCookieWithOptionsAsync(
- origin, "A=1", net::CookieOptions(),
+ GURL("http://www.google.com"), "A=1", net::CookieOptions(),
net::CookieMonster::SetCookiesCallback());
cookie_monster->SetCookieWithOptionsAsync(
- origin, "A=2; Domain=.www.google.com ",
+ GURL("http://www.google.com"), "A=2; Domain=.www.google.com ",
net::CookieOptions(), net::CookieMonster::SetCookiesCallback());
}

Powered by Google App Engine
This is Rietveld 408576698