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

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

Issue 15517005: Remove references to Profile from browser_context_keyed_service. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase & style Created 7 years, 7 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_tracker.h" 5 #include "chrome/browser/signin/signin_tracker.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 "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 22 matching lines...) Expand all
33 namespace { 33 namespace {
34 34
35 class MockTokenService : public TokenService { 35 class MockTokenService : public TokenService {
36 public: 36 public:
37 MockTokenService() { } 37 MockTokenService() { }
38 virtual ~MockTokenService() { } 38 virtual ~MockTokenService() { }
39 39
40 MOCK_CONST_METHOD1(HasTokenForService, bool(const char*)); 40 MOCK_CONST_METHOD1(HasTokenForService, bool(const char*));
41 }; 41 };
42 42
43 ProfileKeyedService* BuildMockTokenService(content::BrowserContext* profile) { 43 BrowserContextKeyedService* BuildMockTokenService(
44 content::BrowserContext* profile) {
44 return new MockTokenService; 45 return new MockTokenService;
45 } 46 }
46 47
47 class MockObserver : public SigninTracker::Observer { 48 class MockObserver : public SigninTracker::Observer {
48 public: 49 public:
49 MockObserver() {} 50 MockObserver() {}
50 ~MockObserver() {} 51 ~MockObserver() {}
51 52
52 MOCK_METHOD0(GaiaCredentialsValid, void(void)); 53 MOCK_METHOD0(GaiaCredentialsValid, void(void));
53 MOCK_METHOD1(SigninFailed, void(const GoogleServiceAuthError&)); 54 MOCK_METHOD1(SigninFailed, void(const GoogleServiceAuthError&));
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 363
363 TEST_F(SigninTrackerTest, SigninFailedWhenInitializing) { 364 TEST_F(SigninTrackerTest, SigninFailedWhenInitializing) {
364 tracker_.reset(); 365 tracker_.reset();
365 // SigninFailed() should be called. 366 // SigninFailed() should be called.
366 GoogleServiceAuthError error(GoogleServiceAuthError::REQUEST_CANCELED); 367 GoogleServiceAuthError error(GoogleServiceAuthError::REQUEST_CANCELED);
367 EXPECT_CALL(observer_, SigninFailed(error)); 368 EXPECT_CALL(observer_, SigninFailed(error));
368 tracker_.reset(new SigninTracker(profile_.get(), &observer_, 369 tracker_.reset(new SigninTracker(profile_.get(), &observer_,
369 SigninTracker::SERVICES_INITIALIZING)); 370 SigninTracker::SERVICES_INITIALIZING));
370 tracker_->OnStateChanged(); 371 tracker_->OnStateChanged();
371 } 372 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698