| 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 "components/sync/engine/activation_context.h" | 8 #include "components/sync/engine/activation_context.h" |
| 9 | 9 |
| 10 namespace syncer { | 10 namespace syncer { |
| 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 SyncFrontend* frontend, | 18 SyncFrontend* frontend, |
| 19 std::unique_ptr<base::Thread> sync_thread, | 19 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 WeakHandle<JsEventHandler>& event_handler, | 22 const WeakHandle<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 SyncCredentials& credentials, | 25 const SyncCredentials& credentials, |
| 26 bool delete_sync_data_folder, | 26 bool delete_sync_data_folder, |
| 27 bool enable_local_sync_backend, | 27 bool enable_local_sync_backend, |
| 28 const base::FilePath& local_sync_backend_folder, | 28 const base::FilePath& local_sync_backend_folder, |
| 29 std::unique_ptr<SyncManagerFactory> sync_manager_factory, | 29 std::unique_ptr<SyncManagerFactory> sync_manager_factory, |
| (...skipping 16 matching lines...) Expand all Loading... |
| 46 void SyncBackendHostMock::SetEncryptionPassphrase(const std::string& passphrase, | 46 void SyncBackendHostMock::SetEncryptionPassphrase(const std::string& passphrase, |
| 47 bool is_explicit) {} | 47 bool is_explicit) {} |
| 48 | 48 |
| 49 bool SyncBackendHostMock::SetDecryptionPassphrase( | 49 bool SyncBackendHostMock::SetDecryptionPassphrase( |
| 50 const std::string& passphrase) { | 50 const std::string& passphrase) { |
| 51 return false; | 51 return false; |
| 52 } | 52 } |
| 53 | 53 |
| 54 void SyncBackendHostMock::StopSyncingForShutdown() {} | 54 void SyncBackendHostMock::StopSyncingForShutdown() {} |
| 55 | 55 |
| 56 std::unique_ptr<base::Thread> SyncBackendHostMock::Shutdown( | 56 void SyncBackendHostMock::Shutdown(ShutdownReason reason) {} |
| 57 ShutdownReason reason) { | |
| 58 return std::unique_ptr<base::Thread>(); | |
| 59 } | |
| 60 | 57 |
| 61 void SyncBackendHostMock::UnregisterInvalidationIds() {} | 58 void SyncBackendHostMock::UnregisterInvalidationIds() {} |
| 62 | 59 |
| 63 ModelTypeSet SyncBackendHostMock::ConfigureDataTypes( | 60 ModelTypeSet SyncBackendHostMock::ConfigureDataTypes( |
| 64 ConfigureReason reason, | 61 ConfigureReason reason, |
| 65 const DataTypeConfigStateMap& config_state_map, | 62 const DataTypeConfigStateMap& config_state_map, |
| 66 const base::Callback<void(ModelTypeSet, ModelTypeSet)>& ready_task, | 63 const base::Callback<void(ModelTypeSet, ModelTypeSet)>& ready_task, |
| 67 const base::Callback<void()>& retry_callback) { | 64 const base::Callback<void()>& retry_callback) { |
| 68 return ModelTypeSet(); | 65 return ModelTypeSet(); |
| 69 } | 66 } |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 bool SyncBackendHostMock::IsCryptographerReady( | 110 bool SyncBackendHostMock::IsCryptographerReady( |
| 114 const BaseTransaction* trans) const { | 111 const BaseTransaction* trans) const { |
| 115 return false; | 112 return false; |
| 116 } | 113 } |
| 117 | 114 |
| 118 void SyncBackendHostMock::GetModelSafeRoutingInfo( | 115 void SyncBackendHostMock::GetModelSafeRoutingInfo( |
| 119 ModelSafeRoutingInfo* out) const {} | 116 ModelSafeRoutingInfo* out) const {} |
| 120 | 117 |
| 121 void SyncBackendHostMock::FlushDirectory() const {} | 118 void SyncBackendHostMock::FlushDirectory() const {} |
| 122 | 119 |
| 123 base::MessageLoop* SyncBackendHostMock::GetSyncLoopForTesting() { | |
| 124 return nullptr; | |
| 125 } | |
| 126 | |
| 127 void SyncBackendHostMock::RefreshTypesForTest(ModelTypeSet types) {} | 120 void SyncBackendHostMock::RefreshTypesForTest(ModelTypeSet types) {} |
| 128 | 121 |
| 129 void SyncBackendHostMock::RequestBufferedProtocolEventsAndEnableForwarding() {} | 122 void SyncBackendHostMock::RequestBufferedProtocolEventsAndEnableForwarding() {} |
| 130 | 123 |
| 131 void SyncBackendHostMock::DisableProtocolEventForwarding() {} | 124 void SyncBackendHostMock::DisableProtocolEventForwarding() {} |
| 132 | 125 |
| 133 void SyncBackendHostMock::EnableDirectoryTypeDebugInfoForwarding() {} | 126 void SyncBackendHostMock::EnableDirectoryTypeDebugInfoForwarding() {} |
| 134 | 127 |
| 135 void SyncBackendHostMock::DisableDirectoryTypeDebugInfoForwarding() {} | 128 void SyncBackendHostMock::DisableDirectoryTypeDebugInfoForwarding() {} |
| 136 | 129 |
| 137 void SyncBackendHostMock::set_fail_initial_download(bool should_fail) { | 130 void SyncBackendHostMock::set_fail_initial_download(bool should_fail) { |
| 138 fail_initial_download_ = should_fail; | 131 fail_initial_download_ = should_fail; |
| 139 } | 132 } |
| 140 | 133 |
| 141 void SyncBackendHostMock::ClearServerData( | 134 void SyncBackendHostMock::ClearServerData( |
| 142 const SyncManager::ClearServerDataCallback& callback) { | 135 const SyncManager::ClearServerDataCallback& callback) { |
| 143 callback.Run(); | 136 callback.Run(); |
| 144 } | 137 } |
| 145 | 138 |
| 146 void SyncBackendHostMock::OnCookieJarChanged(bool account_mismatch, | 139 void SyncBackendHostMock::OnCookieJarChanged(bool account_mismatch, |
| 147 bool empty_jar) {} | 140 bool empty_jar) {} |
| 148 | 141 |
| 149 } // namespace syncer | 142 } // namespace syncer |
| OLD | NEW |