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

Side by Side Diff: chrome/browser/signin/signin_manager_unittest.cc

Issue 11741003: Remove PrefServiceSimple, replacing it with PrefService and PrefRegistrySimple. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Switch to desired interfaces. Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/signin/signin_manager.h" 5 #include "chrome/browser/signin/signin_manager.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/stringprintf.h" 10 #include "base/stringprintf.h"
(...skipping 28 matching lines...) Expand all
39 " \"token_type\": \"Bearer\"" 39 " \"token_type\": \"Bearer\""
40 "}"; 40 "}";
41 41
42 } // namespace 42 } // namespace
43 43
44 44
45 class SigninManagerTest : public TokenServiceTestHarness { 45 class SigninManagerTest : public TokenServiceTestHarness {
46 public: 46 public:
47 virtual void SetUp() OVERRIDE { 47 virtual void SetUp() OVERRIDE {
48 prefs_.reset(new TestingPrefServiceSimple); 48 prefs_.reset(new TestingPrefServiceSimple);
49 chrome::RegisterLocalState(prefs_.get()); 49 chrome::RegisterLocalState(prefs_->registry(), prefs_.get());
50 TestingBrowserProcess::GetGlobal()->SetLocalState( 50 TestingBrowserProcess::GetGlobal()->SetLocalState(
51 prefs_.get()); 51 prefs_.get());
52 TokenServiceTestHarness::SetUp(); 52 TokenServiceTestHarness::SetUp();
53 manager_.reset(new SigninManager()); 53 manager_.reset(new SigninManager());
54 google_login_success_.ListenFor( 54 google_login_success_.ListenFor(
55 chrome::NOTIFICATION_GOOGLE_SIGNIN_SUCCESSFUL, 55 chrome::NOTIFICATION_GOOGLE_SIGNIN_SUCCESSFUL,
56 content::Source<Profile>(profile_.get())); 56 content::Source<Profile>(profile_.get()));
57 google_login_failure_.ListenFor(chrome::NOTIFICATION_GOOGLE_SIGNIN_FAILED, 57 google_login_failure_.ListenFor(chrome::NOTIFICATION_GOOGLE_SIGNIN_FAILED,
58 content::Source<Profile>(profile_.get())); 58 content::Source<Profile>(profile_.get()));
59 } 59 }
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 490
491 manager_->ProvideOAuthChallengeResponse( 491 manager_->ProvideOAuthChallengeResponse(
492 GoogleServiceAuthError::CAPTCHA_REQUIRED, "token", "solution"); 492 GoogleServiceAuthError::CAPTCHA_REQUIRED, "token", "solution");
493 493
494 SimulateProvideOAuthChallengeResponseValid(); 494 SimulateProvideOAuthChallengeResponseValid();
495 EXPECT_EQ("user@gmail.com", manager_->GetAuthenticatedUsername()); 495 EXPECT_EQ("user@gmail.com", manager_->GetAuthenticatedUsername());
496 496
497 EXPECT_EQ(1U, google_login_success_.size()); 497 EXPECT_EQ(1U, google_login_success_.size());
498 EXPECT_EQ(1U, google_login_failure_.size()); 498 EXPECT_EQ(1U, google_login_failure_.size());
499 } 499 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698