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

Side by Side Diff: chrome/browser/sync/profile_sync_service_startup_unittest.cc

Issue 148513010: Eliminate ProfileOAuth2TokenService being a BCKS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Response to review Created 6 years, 10 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 "base/file_util.h" 5 #include "base/file_util.h"
6 #include "base/memory/scoped_ptr.h" 6 #include "base/memory/scoped_ptr.h"
7 #include "base/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "chrome/browser/chrome_notification_types.h" 8 #include "chrome/browser/chrome_notification_types.h"
9 #include "chrome/browser/signin/fake_profile_oauth2_token_service.h" 9 #include "chrome/browser/signin/fake_profile_oauth2_token_service.h"
10 #include "chrome/browser/signin/fake_profile_oauth2_token_service_wrapper.h"
10 #include "chrome/browser/signin/fake_signin_manager.h" 11 #include "chrome/browser/signin/fake_signin_manager.h"
11 #include "chrome/browser/signin/profile_oauth2_token_service.h" 12 #include "chrome/browser/signin/profile_oauth2_token_service.h"
12 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" 13 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
13 #include "chrome/browser/signin/signin_manager.h" 14 #include "chrome/browser/signin/signin_manager.h"
14 #include "chrome/browser/signin/signin_manager_factory.h" 15 #include "chrome/browser/signin/signin_manager_factory.h"
15 #include "chrome/browser/sync/glue/sync_backend_host_mock.h" 16 #include "chrome/browser/sync/glue/sync_backend_host_mock.h"
16 #include "chrome/browser/sync/profile_sync_components_factory_mock.h" 17 #include "chrome/browser/sync/profile_sync_components_factory_mock.h"
17 #include "chrome/browser/sync/profile_sync_service_factory.h" 18 #include "chrome/browser/sync/profile_sync_service_factory.h"
18 #include "chrome/browser/sync/profile_sync_test_util.h" 19 #include "chrome/browser/sync/profile_sync_test_util.h"
19 #include "chrome/browser/sync/sync_prefs.h" 20 #include "chrome/browser/sync/sync_prefs.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 virtual void SetUp() { 71 virtual void SetUp() {
71 profile_ = CreateProfile(); 72 profile_ = CreateProfile();
72 } 73 }
73 74
74 virtual scoped_ptr<TestingProfile> CreateProfile() { 75 virtual scoped_ptr<TestingProfile> CreateProfile() {
75 TestingProfile::Builder builder; 76 TestingProfile::Builder builder;
76 builder.AddTestingFactory(SigninManagerFactory::GetInstance(), 77 builder.AddTestingFactory(SigninManagerFactory::GetInstance(),
77 FakeSigninManagerBase::Build); 78 FakeSigninManagerBase::Build);
78 builder.AddTestingFactory( 79 builder.AddTestingFactory(
79 ProfileOAuth2TokenServiceFactory::GetInstance(), 80 ProfileOAuth2TokenServiceFactory::GetInstance(),
80 FakeProfileOAuth2TokenService::BuildAutoIssuingTokenService); 81 FakeProfileOAuth2TokenServiceWrapper::BuildAutoIssuingTokenService);
81 builder.AddTestingFactory(ProfileSyncServiceFactory::GetInstance(), 82 builder.AddTestingFactory(ProfileSyncServiceFactory::GetInstance(),
82 BuildService); 83 BuildService);
83 return builder.Build(); 84 return builder.Build();
84 } 85 }
85 86
86 virtual void TearDown() { 87 virtual void TearDown() {
87 sync_->RemoveObserver(&observer_); 88 sync_->RemoveObserver(&observer_);
88 profile_.reset(); 89 profile_.reset();
89 } 90 }
90 91
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 profile_->GetPrefs()->ClearPref(prefs::kSyncHasSetupCompleted); 515 profile_->GetPrefs()->ClearPref(prefs::kSyncHasSetupCompleted);
515 516
516 EXPECT_CALL(observer_, OnStateChanged()).Times(AnyNumber()); 517 EXPECT_CALL(observer_, OnStateChanged()).Times(AnyNumber());
517 IssueTestTokens(); 518 IssueTestTokens();
518 519
519 sync_->SetSetupInProgress(true); 520 sync_->SetSetupInProgress(true);
520 sync_->Initialize(); 521 sync_->Initialize();
521 sync_->SetSetupInProgress(false); 522 sync_->SetSetupInProgress(false);
522 EXPECT_FALSE(sync_->sync_initialized()); 523 EXPECT_FALSE(sync_->sync_initialized());
523 } 524 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698