| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "components/sync_driver/glue/sync_backend_host_mock.h" | 5 #include "components/sync_driver/glue/sync_backend_host_mock.h" |
| 6 | 6 |
| 7 #include "components/sync_driver/sync_frontend.h" | 7 #include "components/sync_driver/sync_frontend.h" |
| 8 #include "sync/internal_api/public/activation_context.h" | 8 #include "sync/internal_api/public/activation_context.h" |
| 9 | 9 |
| 10 namespace browser_sync { | 10 namespace browser_sync { |
| 11 | 11 |
| 12 const char kTestCacheGuid[] = "test-guid"; | 12 const char kTestCacheGuid[] = "test-guid"; |
| 13 | 13 |
| 14 SyncBackendHostMock::SyncBackendHostMock() : fail_initial_download_(false) {} | 14 SyncBackendHostMock::SyncBackendHostMock() : fail_initial_download_(false) {} |
| 15 SyncBackendHostMock::~SyncBackendHostMock() {} | 15 SyncBackendHostMock::~SyncBackendHostMock() {} |
| 16 | 16 |
| 17 void SyncBackendHostMock::Initialize( | 17 void SyncBackendHostMock::Initialize( |
| 18 sync_driver::SyncFrontend* frontend, | 18 sync_driver::SyncFrontend* frontend, |
| 19 scoped_ptr<base::Thread> sync_thread, | 19 std::unique_ptr<base::Thread> sync_thread, |
| 20 const scoped_refptr<base::SingleThreadTaskRunner>& db_thread, | 20 const scoped_refptr<base::SingleThreadTaskRunner>& db_thread, |
| 21 const scoped_refptr<base::SingleThreadTaskRunner>& file_thread, | 21 const scoped_refptr<base::SingleThreadTaskRunner>& file_thread, |
| 22 const syncer::WeakHandle<syncer::JsEventHandler>& event_handler, | 22 const syncer::WeakHandle<syncer::JsEventHandler>& event_handler, |
| 23 const GURL& service_url, | 23 const GURL& service_url, |
| 24 const std::string& sync_user_agent, | 24 const std::string& sync_user_agent, |
| 25 const syncer::SyncCredentials& credentials, | 25 const syncer::SyncCredentials& credentials, |
| 26 bool delete_sync_data_folder, | 26 bool delete_sync_data_folder, |
| 27 scoped_ptr<syncer::SyncManagerFactory> sync_manager_factory, | 27 std::unique_ptr<syncer::SyncManagerFactory> sync_manager_factory, |
| 28 const syncer::WeakHandle<syncer::UnrecoverableErrorHandler>& | 28 const syncer::WeakHandle<syncer::UnrecoverableErrorHandler>& |
| 29 unrecoverable_error_handler, | 29 unrecoverable_error_handler, |
| 30 const base::Closure& report_unrecoverable_error_function, | 30 const base::Closure& report_unrecoverable_error_function, |
| 31 const HttpPostProviderFactoryGetter& http_post_provider_factory_getter, | 31 const HttpPostProviderFactoryGetter& http_post_provider_factory_getter, |
| 32 scoped_ptr<syncer::SyncEncryptionHandler::NigoriState> saved_nigori_state) { | 32 std::unique_ptr<syncer::SyncEncryptionHandler::NigoriState> |
| 33 saved_nigori_state) { |
| 33 frontend->OnBackendInitialized( | 34 frontend->OnBackendInitialized( |
| 34 syncer::WeakHandle<syncer::JsBackend>(), | 35 syncer::WeakHandle<syncer::JsBackend>(), |
| 35 syncer::WeakHandle<syncer::DataTypeDebugInfoListener>(), | 36 syncer::WeakHandle<syncer::DataTypeDebugInfoListener>(), |
| 36 kTestCacheGuid, | 37 kTestCacheGuid, |
| 37 !fail_initial_download_); | 38 !fail_initial_download_); |
| 38 } | 39 } |
| 39 | 40 |
| 40 void SyncBackendHostMock::TriggerRefresh(const syncer::ModelTypeSet& types) {} | 41 void SyncBackendHostMock::TriggerRefresh(const syncer::ModelTypeSet& types) {} |
| 41 | 42 |
| 42 void SyncBackendHostMock::UpdateCredentials( | 43 void SyncBackendHostMock::UpdateCredentials( |
| 43 const syncer::SyncCredentials& credentials) {} | 44 const syncer::SyncCredentials& credentials) {} |
| 44 | 45 |
| 45 void SyncBackendHostMock::StartSyncingWithServer() {} | 46 void SyncBackendHostMock::StartSyncingWithServer() {} |
| 46 | 47 |
| 47 void SyncBackendHostMock::SetEncryptionPassphrase( | 48 void SyncBackendHostMock::SetEncryptionPassphrase( |
| 48 const std::string& passphrase, | 49 const std::string& passphrase, |
| 49 bool is_explicit) {} | 50 bool is_explicit) {} |
| 50 | 51 |
| 51 bool SyncBackendHostMock::SetDecryptionPassphrase( | 52 bool SyncBackendHostMock::SetDecryptionPassphrase( |
| 52 const std::string& passphrase) { | 53 const std::string& passphrase) { |
| 53 return false; | 54 return false; |
| 54 } | 55 } |
| 55 | 56 |
| 56 void SyncBackendHostMock::StopSyncingForShutdown() {} | 57 void SyncBackendHostMock::StopSyncingForShutdown() {} |
| 57 | 58 |
| 58 scoped_ptr<base::Thread> SyncBackendHostMock::Shutdown( | 59 std::unique_ptr<base::Thread> SyncBackendHostMock::Shutdown( |
| 59 syncer::ShutdownReason reason) { | 60 syncer::ShutdownReason reason) { |
| 60 return scoped_ptr<base::Thread>(); | 61 return std::unique_ptr<base::Thread>(); |
| 61 } | 62 } |
| 62 | 63 |
| 63 void SyncBackendHostMock::UnregisterInvalidationIds() {} | 64 void SyncBackendHostMock::UnregisterInvalidationIds() {} |
| 64 | 65 |
| 65 syncer::ModelTypeSet SyncBackendHostMock::ConfigureDataTypes( | 66 syncer::ModelTypeSet SyncBackendHostMock::ConfigureDataTypes( |
| 66 syncer::ConfigureReason reason, | 67 syncer::ConfigureReason reason, |
| 67 const DataTypeConfigStateMap& config_state_map, | 68 const DataTypeConfigStateMap& config_state_map, |
| 68 const base::Callback<void(syncer::ModelTypeSet, syncer::ModelTypeSet)>& | 69 const base::Callback<void(syncer::ModelTypeSet, syncer::ModelTypeSet)>& |
| 69 ready_task, | 70 ready_task, |
| 70 const base::Callback<void()>& retry_callback) { | 71 const base::Callback<void()>& retry_callback) { |
| 71 return syncer::ModelTypeSet(); | 72 return syncer::ModelTypeSet(); |
| 72 } | 73 } |
| 73 | 74 |
| 74 void SyncBackendHostMock::EnableEncryptEverything() {} | 75 void SyncBackendHostMock::EnableEncryptEverything() {} |
| 75 | 76 |
| 76 void SyncBackendHostMock::ActivateDirectoryDataType( | 77 void SyncBackendHostMock::ActivateDirectoryDataType( |
| 77 syncer::ModelType type, | 78 syncer::ModelType type, |
| 78 syncer::ModelSafeGroup group, | 79 syncer::ModelSafeGroup group, |
| 79 sync_driver::ChangeProcessor* change_processor) {} | 80 sync_driver::ChangeProcessor* change_processor) {} |
| 80 void SyncBackendHostMock::DeactivateDirectoryDataType(syncer::ModelType type) {} | 81 void SyncBackendHostMock::DeactivateDirectoryDataType(syncer::ModelType type) {} |
| 81 | 82 |
| 82 void SyncBackendHostMock::ActivateNonBlockingDataType( | 83 void SyncBackendHostMock::ActivateNonBlockingDataType( |
| 83 syncer::ModelType type, | 84 syncer::ModelType type, |
| 84 scoped_ptr<syncer_v2::ActivationContext> activation_context) {} | 85 std::unique_ptr<syncer_v2::ActivationContext> activation_context) {} |
| 85 | 86 |
| 86 void SyncBackendHostMock::DeactivateNonBlockingDataType( | 87 void SyncBackendHostMock::DeactivateNonBlockingDataType( |
| 87 syncer::ModelType type) {} | 88 syncer::ModelType type) {} |
| 88 | 89 |
| 89 syncer::UserShare* SyncBackendHostMock::GetUserShare() const { | 90 syncer::UserShare* SyncBackendHostMock::GetUserShare() const { |
| 90 return NULL; | 91 return NULL; |
| 91 } | 92 } |
| 92 | 93 |
| 93 SyncBackendHost::Status SyncBackendHostMock::GetDetailedStatus() { | 94 SyncBackendHost::Status SyncBackendHostMock::GetDetailedStatus() { |
| 94 return SyncBackendHost::Status(); | 95 return SyncBackendHost::Status(); |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 } | 150 } |
| 150 | 151 |
| 151 void SyncBackendHostMock::ClearServerData( | 152 void SyncBackendHostMock::ClearServerData( |
| 152 const syncer::SyncManager::ClearServerDataCallback& callback) { | 153 const syncer::SyncManager::ClearServerDataCallback& callback) { |
| 153 callback.Run(); | 154 callback.Run(); |
| 154 } | 155 } |
| 155 | 156 |
| 156 void SyncBackendHostMock::OnCookieJarChanged(bool account_mismatch) {} | 157 void SyncBackendHostMock::OnCookieJarChanged(bool account_mismatch) {} |
| 157 | 158 |
| 158 } // namespace browser_sync | 159 } // namespace browser_sync |
| OLD | NEW |