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

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

Issue 9703038: Profiles: Really fix refcounted services. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Forgot to save a file. >_< Created 8 years, 9 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 17 matching lines...) Expand all
28 using ::testing::ReturnRef; 28 using ::testing::ReturnRef;
29 29
30 class MockTokenService : public TokenService { 30 class MockTokenService : public TokenService {
31 public: 31 public:
32 MockTokenService() { } 32 MockTokenService() { }
33 virtual ~MockTokenService() { } 33 virtual ~MockTokenService() { }
34 34
35 MOCK_CONST_METHOD1(HasTokenForService, bool(const char*)); 35 MOCK_CONST_METHOD1(HasTokenForService, bool(const char*));
36 }; 36 };
37 37
38 ProfileKeyedBase* BuildMockTokenService(Profile* profile) { 38 ProfileKeyedService* BuildMockTokenService(Profile* profile) {
39 return new MockTokenService; 39 return new MockTokenService;
40 } 40 }
41 41
42 class MockObserver : public SigninTracker::Observer { 42 class MockObserver : public SigninTracker::Observer {
43 public: 43 public:
44 MockObserver() {} 44 MockObserver() {}
45 ~MockObserver() {} 45 ~MockObserver() {}
46 46
47 MOCK_METHOD0(GaiaCredentialsValid, void(void)); 47 MOCK_METHOD0(GaiaCredentialsValid, void(void));
48 MOCK_METHOD1(SigninFailed, void(const GoogleServiceAuthError&)); 48 MOCK_METHOD1(SigninFailed, void(const GoogleServiceAuthError&));
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 // Now mimic an auth error - this should cause us to fail (not waiting for 267 // Now mimic an auth error - this should cause us to fail (not waiting for
268 // auth, but still have no credentials). 268 // auth, but still have no credentials).
269 GoogleServiceAuthError error( 269 GoogleServiceAuthError error(
270 GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS); 270 GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS);
271 EXPECT_CALL(*mock_pss_, GetAuthError()).WillRepeatedly(ReturnRef(error)); 271 EXPECT_CALL(*mock_pss_, GetAuthError()).WillRepeatedly(ReturnRef(error));
272 EXPECT_CALL(*mock_pss_, waiting_for_auth()).WillOnce(Return(false)); 272 EXPECT_CALL(*mock_pss_, waiting_for_auth()).WillOnce(Return(false));
273 EXPECT_CALL(observer_, SigninFailed(error)); 273 EXPECT_CALL(observer_, SigninFailed(error));
274 tracker_->OnStateChanged(); 274 tracker_->OnStateChanged();
275 } 275 }
276 276
OLDNEW
« no previous file with comments | « chrome/browser/signin/signin_manager_fake.cc ('k') | chrome/browser/spellchecker/spellcheck_profile_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698