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

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

Issue 11046008: [Invalidations] Require there to be no registered handlers on Invalidator destruction (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync to HEAD Created 8 years, 2 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
« no previous file with comments | « no previous file | chrome/browser/sync/invalidation_frontend.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 SigninTrackerTest() {} 54 SigninTrackerTest() {}
55 virtual void SetUp() OVERRIDE { 55 virtual void SetUp() OVERRIDE {
56 profile_.reset(ProfileSyncServiceMock::MakeSignedInTestingProfile()); 56 profile_.reset(ProfileSyncServiceMock::MakeSignedInTestingProfile());
57 mock_token_service_ = static_cast<MockTokenService*>( 57 mock_token_service_ = static_cast<MockTokenService*>(
58 TokenServiceFactory::GetInstance()->SetTestingFactoryAndUse( 58 TokenServiceFactory::GetInstance()->SetTestingFactoryAndUse(
59 profile_.get(), BuildMockTokenService)); 59 profile_.get(), BuildMockTokenService));
60 mock_pss_ = static_cast<ProfileSyncServiceMock*>( 60 mock_pss_ = static_cast<ProfileSyncServiceMock*>(
61 ProfileSyncServiceFactory::GetInstance()->SetTestingFactoryAndUse( 61 ProfileSyncServiceFactory::GetInstance()->SetTestingFactoryAndUse(
62 profile_.get(), 62 profile_.get(),
63 ProfileSyncServiceMock::BuildMockProfileSyncService)); 63 ProfileSyncServiceMock::BuildMockProfileSyncService));
64 mock_pss_->Initialize();
64 // Make gmock not spam the output with information about these uninteresting 65 // Make gmock not spam the output with information about these uninteresting
65 // calls. 66 // calls.
66 EXPECT_CALL(*mock_pss_, AddObserver(_)).Times(AnyNumber()); 67 EXPECT_CALL(*mock_pss_, AddObserver(_)).Times(AnyNumber());
67 EXPECT_CALL(*mock_pss_, RemoveObserver(_)).Times(AnyNumber()); 68 EXPECT_CALL(*mock_pss_, RemoveObserver(_)).Times(AnyNumber());
68 tracker_.reset(new SigninTracker(profile_.get(), &observer_)); 69 tracker_.reset(new SigninTracker(profile_.get(), &observer_));
69 } 70 }
70 virtual void TearDown() OVERRIDE { 71 virtual void TearDown() OVERRIDE {
71 tracker_.reset(); 72 tracker_.reset();
72 profile_.reset(); 73 profile_.reset();
73 } 74 }
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 EXPECT_CALL(*mock_pss_, waiting_for_auth()).WillRepeatedly(Return(false)); 328 EXPECT_CALL(*mock_pss_, waiting_for_auth()).WillRepeatedly(Return(false));
328 EXPECT_CALL(*mock_pss_, GetAuthError()).WillRepeatedly(ReturnRef(error)); 329 EXPECT_CALL(*mock_pss_, GetAuthError()).WillRepeatedly(ReturnRef(error));
329 EXPECT_CALL(*mock_pss_, HasUnrecoverableError()).WillRepeatedly( 330 EXPECT_CALL(*mock_pss_, HasUnrecoverableError()).WillRepeatedly(
330 Return(false)); 331 Return(false));
331 EXPECT_CALL(*mock_pss_, sync_initialized()).WillRepeatedly(Return(true)); 332 EXPECT_CALL(*mock_pss_, sync_initialized()).WillRepeatedly(Return(true));
332 // Any error should result in SigninFailed() being called. 333 // Any error should result in SigninFailed() being called.
333 EXPECT_CALL(observer_, SigninFailed(error)); 334 EXPECT_CALL(observer_, SigninFailed(error));
334 tracker_.reset(new SigninTracker(profile_.get(), &observer_, 335 tracker_.reset(new SigninTracker(profile_.get(), &observer_,
335 SigninTracker::SERVICES_INITIALIZING)); 336 SigninTracker::SERVICES_INITIALIZING));
336 } 337 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync/invalidation_frontend.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698