OLD | NEW |
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/files/file_util.h" | 5 #include "base/files/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 "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "chrome/browser/prefs/pref_service_syncable.h" | 9 #include "chrome/browser/prefs/pref_service_syncable.h" |
10 #include "chrome/browser/signin/account_tracker_service_factory.h" | 10 #include "chrome/browser/signin/account_tracker_service_factory.h" |
11 #include "chrome/browser/signin/fake_profile_oauth2_token_service_builder.h" | 11 #include "chrome/browser/signin/fake_profile_oauth2_token_service_builder.h" |
12 #include "chrome/browser/signin/fake_signin_manager.h" | 12 #include "chrome/browser/signin/fake_signin_manager_builder.h" |
13 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" | 13 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" |
14 #include "chrome/browser/signin/signin_manager_factory.h" | 14 #include "chrome/browser/signin/signin_manager_factory.h" |
15 #include "chrome/browser/sync/glue/sync_backend_host_mock.h" | 15 #include "chrome/browser/sync/glue/sync_backend_host_mock.h" |
16 #include "chrome/browser/sync/profile_sync_components_factory_mock.h" | 16 #include "chrome/browser/sync/profile_sync_components_factory_mock.h" |
17 #include "chrome/browser/sync/profile_sync_service_factory.h" | 17 #include "chrome/browser/sync/profile_sync_service_factory.h" |
18 #include "chrome/browser/sync/profile_sync_test_util.h" | 18 #include "chrome/browser/sync/profile_sync_test_util.h" |
19 #include "chrome/browser/sync/supervised_user_signin_manager_wrapper.h" | 19 #include "chrome/browser/sync/supervised_user_signin_manager_wrapper.h" |
20 #include "chrome/common/pref_names.h" | 20 #include "chrome/common/pref_names.h" |
21 #include "chrome/test/base/testing_browser_process.h" | 21 #include "chrome/test/base/testing_browser_process.h" |
22 #include "chrome/test/base/testing_profile.h" | 22 #include "chrome/test/base/testing_profile.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 content::TestBrowserThreadBundle::REAL_IO_THREAD), | 96 content::TestBrowserThreadBundle::REAL_IO_THREAD), |
97 profile_manager_(TestingBrowserProcess::GetGlobal()), | 97 profile_manager_(TestingBrowserProcess::GetGlobal()), |
98 sync_(NULL) {} | 98 sync_(NULL) {} |
99 | 99 |
100 ~ProfileSyncServiceStartupTest() override {} | 100 ~ProfileSyncServiceStartupTest() override {} |
101 | 101 |
102 void SetUp() override { | 102 void SetUp() override { |
103 CHECK(profile_manager_.SetUp()); | 103 CHECK(profile_manager_.SetUp()); |
104 | 104 |
105 TestingProfile::TestingFactories testing_facotries; | 105 TestingProfile::TestingFactories testing_facotries; |
106 testing_facotries.push_back( | 106 testing_facotries.push_back(std::make_pair( |
107 std::make_pair(SigninManagerFactory::GetInstance(), | 107 SigninManagerFactory::GetInstance(), BuildFakeSigninManagerBase)); |
108 FakeSigninManagerBase::Build)); | |
109 testing_facotries.push_back( | 108 testing_facotries.push_back( |
110 std::make_pair(ProfileOAuth2TokenServiceFactory::GetInstance(), | 109 std::make_pair(ProfileOAuth2TokenServiceFactory::GetInstance(), |
111 BuildAutoIssuingFakeProfileOAuth2TokenService)); | 110 BuildAutoIssuingFakeProfileOAuth2TokenService)); |
112 testing_facotries.push_back( | 111 testing_facotries.push_back( |
113 std::make_pair(ProfileSyncServiceFactory::GetInstance(), | 112 std::make_pair(ProfileSyncServiceFactory::GetInstance(), |
114 BuildService)); | 113 BuildService)); |
115 | 114 |
116 profile_ = profile_manager_.CreateTestingProfile( | 115 profile_ = profile_manager_.CreateTestingProfile( |
117 "sync-startup-test", scoped_ptr<PrefServiceSyncable>(), | 116 "sync-startup-test", scoped_ptr<PrefServiceSyncable>(), |
118 base::UTF8ToUTF16("sync-startup-test"), 0, std::string(), | 117 base::UTF8ToUTF16("sync-startup-test"), 0, std::string(), |
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
572 profile_->GetPrefs()->ClearPref(sync_driver::prefs::kSyncHasSetupCompleted); | 571 profile_->GetPrefs()->ClearPref(sync_driver::prefs::kSyncHasSetupCompleted); |
573 | 572 |
574 EXPECT_CALL(observer_, OnStateChanged()).Times(AnyNumber()); | 573 EXPECT_CALL(observer_, OnStateChanged()).Times(AnyNumber()); |
575 sync_->Initialize(); | 574 sync_->Initialize(); |
576 | 575 |
577 sync_->SetSetupInProgress(true); | 576 sync_->SetSetupInProgress(true); |
578 IssueTestTokens(account_id); | 577 IssueTestTokens(account_id); |
579 sync_->SetSetupInProgress(false); | 578 sync_->SetSetupInProgress(false); |
580 EXPECT_FALSE(sync_->IsSyncActive()); | 579 EXPECT_FALSE(sync_->IsSyncActive()); |
581 } | 580 } |
OLD | NEW |