| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/sync/test_profile_sync_service.h" | 5 #include "chrome/browser/sync/test_profile_sync_service.h" |
| 6 | 6 |
| 7 #include "chrome/browser/sync/abstract_profile_sync_service_test.h" | 7 #include "chrome/browser/sync/abstract_profile_sync_service_test.h" |
| 8 #include "chrome/browser/sync/glue/data_type_controller.h" | 8 #include "chrome/browser/sync/glue/data_type_controller.h" |
| 9 #include "chrome/browser/sync/glue/sync_backend_host.h" | 9 #include "chrome/browser/sync/glue/sync_backend_host.h" |
| 10 #include "chrome/browser/sync/internal_api/user_share.h" | 10 #include "chrome/browser/sync/internal_api/user_share.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 class FakeSigninManager : public SigninManager { | 32 class FakeSigninManager : public SigninManager { |
| 33 public: | 33 public: |
| 34 FakeSigninManager() {} | 34 FakeSigninManager() {} |
| 35 virtual ~FakeSigninManager() {} | 35 virtual ~FakeSigninManager() {} |
| 36 | 36 |
| 37 virtual void StartSignIn(const std::string& username, | 37 virtual void StartSignIn(const std::string& username, |
| 38 const std::string& password, | 38 const std::string& password, |
| 39 const std::string& login_token, | 39 const std::string& login_token, |
| 40 const std::string& login_captcha) OVERRIDE { | 40 const std::string& login_captcha) OVERRIDE { |
| 41 SetUsername(username); | 41 SetAuthenticatedUsername(username); |
| 42 } | 42 } |
| 43 }; | 43 }; |
| 44 | 44 |
| 45 } // namespace | 45 } // namespace |
| 46 | 46 |
| 47 namespace browser_sync { | 47 namespace browser_sync { |
| 48 | 48 |
| 49 SyncBackendHostForProfileSyncTest::SyncBackendHostForProfileSyncTest( | 49 SyncBackendHostForProfileSyncTest::SyncBackendHostForProfileSyncTest( |
| 50 Profile* profile, | 50 Profile* profile, |
| 51 const base::WeakPtr<SyncPrefs>& sync_prefs, | 51 const base::WeakPtr<SyncPrefs>& sync_prefs, |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 bool synchronous_backend_initialization, | 141 bool synchronous_backend_initialization, |
| 142 const base::Closure& callback) | 142 const base::Closure& callback) |
| 143 : ProfileSyncService(factory, profile, new FakeSigninManager(), test_user), | 143 : ProfileSyncService(factory, profile, new FakeSigninManager(), test_user), |
| 144 synchronous_backend_initialization_( | 144 synchronous_backend_initialization_( |
| 145 synchronous_backend_initialization), | 145 synchronous_backend_initialization), |
| 146 synchronous_sync_configuration_(false), | 146 synchronous_sync_configuration_(false), |
| 147 callback_(callback), | 147 callback_(callback), |
| 148 set_initial_sync_ended_on_init_(true), | 148 set_initial_sync_ended_on_init_(true), |
| 149 fail_initial_download_(false) { | 149 fail_initial_download_(false) { |
| 150 SetSyncSetupCompleted(); | 150 SetSyncSetupCompleted(); |
| 151 signin_->SetAuthenticatedUsername(test_user); |
| 151 } | 152 } |
| 152 | 153 |
| 153 TestProfileSyncService::~TestProfileSyncService() {} | 154 TestProfileSyncService::~TestProfileSyncService() {} |
| 154 | 155 |
| 155 void TestProfileSyncService::SetInitialSyncEndedForAllTypes() { | 156 void TestProfileSyncService::SetInitialSyncEndedForAllTypes() { |
| 156 UserShare* user_share = GetUserShare(); | 157 UserShare* user_share = GetUserShare(); |
| 157 DirectoryManager* dir_manager = user_share->dir_manager.get(); | 158 DirectoryManager* dir_manager = user_share->dir_manager.get(); |
| 158 | 159 |
| 159 ScopedDirLookup dir(dir_manager, user_share->name); | 160 ScopedDirLookup dir(dir_manager, user_share->name); |
| 160 if (!dir.good()) | 161 if (!dir.good()) |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 } | 238 } |
| 238 | 239 |
| 239 void TestProfileSyncService::CreateBackend() { | 240 void TestProfileSyncService::CreateBackend() { |
| 240 backend_.reset(new browser_sync::SyncBackendHostForProfileSyncTest( | 241 backend_.reset(new browser_sync::SyncBackendHostForProfileSyncTest( |
| 241 profile(), | 242 profile(), |
| 242 sync_prefs_.AsWeakPtr(), | 243 sync_prefs_.AsWeakPtr(), |
| 243 set_initial_sync_ended_on_init_, | 244 set_initial_sync_ended_on_init_, |
| 244 synchronous_backend_initialization_, | 245 synchronous_backend_initialization_, |
| 245 fail_initial_download_)); | 246 fail_initial_download_)); |
| 246 } | 247 } |
| OLD | NEW |