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

Unified Diff: chrome/browser/signin/signin_manager_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/signin/signin_manager_unittest.cc
diff --git a/chrome/browser/signin/signin_manager_unittest.cc b/chrome/browser/signin/signin_manager_unittest.cc
index f008430cf37a7db7b9b322562cc2e717e29db8d2..d1c77b950a2e9d2d9b74fac2cad2d3b83c056296 100644
--- a/chrome/browser/signin/signin_manager_unittest.cc
+++ b/chrome/browser/signin/signin_manager_unittest.cc
@@ -23,6 +23,8 @@
#include "chrome/test/base/testing_profile.h"
#include "components/webdata/encryptor/encryptor.h"
#include "content/public/browser/child_process_security_policy.h"
+#include "content/public/browser/cookie_store_map.h"
+#include "content/public/browser/storage_partition.h"
#include "content/public/test/test_browser_thread_bundle.h"
#include "google_apis/gaia/gaia_constants.h"
#include "google_apis/gaia/gaia_urls.h"
@@ -200,6 +202,16 @@ class SigninManagerTest : public TokenServiceTestHarness {
manager_->SignOut();
}
+ net::CookieMonster* GetHttpCookieMonster() {
+ using content::BrowserContext;
+ // Since it's a unittest, assume default StoragePartition.
+ const content::CookieStoreMap& cookie_store_map =
+ BrowserContext::GetDefaultStoragePartition(profile())->
+ GetCookieStoreMap();
+ return cookie_store_map.GetForScheme(chrome::kHttpScheme)->
+ GetCookieMonster();
+ }
+
net::TestURLFetcherFactory factory_;
scoped_ptr<SigninManager> manager_;
content::TestNotificationTracker google_login_success_;
@@ -289,8 +301,7 @@ TEST_F(SigninManagerTest, SignInWithCredentialsEmptyPasswordValidCookie) {
EXPECT_TRUE(manager_->GetAuthenticatedUsername().empty());
// Set a valid LSID cookie in the test cookie store.
- scoped_refptr<net::CookieMonster> cookie_monster =
- profile()->GetCookieMonster();
+ scoped_refptr<net::CookieMonster> cookie_monster = GetHttpCookieMonster();
net::CookieOptions options;
options.set_include_httponly();
cookie_monster->SetCookieWithOptionsAsync(
@@ -334,8 +345,7 @@ TEST_F(SigninManagerTest, SignInWithCredentialsEmptyPasswordInValidCookie) {
EXPECT_TRUE(manager_->GetAuthenticatedUsername().empty());
// Set an invalid LSID cookie in the test cookie store.
- scoped_refptr<net::CookieMonster> cookie_monster =
- profile()->GetCookieMonster();
+ scoped_refptr<net::CookieMonster> cookie_monster = GetHttpCookieMonster();
net::CookieOptions options;
options.set_include_httponly();
cookie_monster->SetCookieWithOptionsAsync(

Powered by Google App Engine
This is Rietveld 408576698