| 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 #ifndef COMPONENTS_SYNC_DRIVER_GLUE_SYNC_BACKEND_HOST_MOCK_H_ | 5 #ifndef COMPONENTS_SYNC_DRIVER_GLUE_SYNC_BACKEND_HOST_MOCK_H_ |
| 6 #define COMPONENTS_SYNC_DRIVER_GLUE_SYNC_BACKEND_HOST_MOCK_H_ | 6 #define COMPONENTS_SYNC_DRIVER_GLUE_SYNC_BACKEND_HOST_MOCK_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 // get through initialization. It often returns null pointers or nonesense | 21 // get through initialization. It often returns null pointers or nonesense |
| 22 // values; it is not intended to be used in tests that depend on SyncBackendHost | 22 // values; it is not intended to be used in tests that depend on SyncBackendHost |
| 23 // behavior. | 23 // behavior. |
| 24 class SyncBackendHostMock : public SyncBackendHost { | 24 class SyncBackendHostMock : public SyncBackendHost { |
| 25 public: | 25 public: |
| 26 SyncBackendHostMock(); | 26 SyncBackendHostMock(); |
| 27 ~SyncBackendHostMock() override; | 27 ~SyncBackendHostMock() override; |
| 28 | 28 |
| 29 void Initialize( | 29 void Initialize( |
| 30 SyncFrontend* frontend, | 30 SyncFrontend* frontend, |
| 31 std::unique_ptr<base::Thread> sync_thread, | 31 base::Thread* sync_thread, |
| 32 const scoped_refptr<base::SingleThreadTaskRunner>& db_thread, | 32 const scoped_refptr<base::SingleThreadTaskRunner>& db_thread, |
| 33 const scoped_refptr<base::SingleThreadTaskRunner>& file_thread, | 33 const scoped_refptr<base::SingleThreadTaskRunner>& file_thread, |
| 34 const WeakHandle<JsEventHandler>& event_handler, | 34 const WeakHandle<JsEventHandler>& event_handler, |
| 35 const GURL& service_url, | 35 const GURL& service_url, |
| 36 const std::string& sync_user_agent, | 36 const std::string& sync_user_agent, |
| 37 const SyncCredentials& credentials, | 37 const SyncCredentials& credentials, |
| 38 bool delete_sync_data_folder, | 38 bool delete_sync_data_folder, |
| 39 bool enable_local_sync_backend, | 39 bool enable_local_sync_backend, |
| 40 const base::FilePath& local_sync_backend_folder, | 40 const base::FilePath& local_sync_backend_folder, |
| 41 std::unique_ptr<SyncManagerFactory> sync_manager_factory, | 41 std::unique_ptr<SyncManagerFactory> sync_manager_factory, |
| 42 const WeakHandle<UnrecoverableErrorHandler>& unrecoverable_error_handler, | 42 const WeakHandle<UnrecoverableErrorHandler>& unrecoverable_error_handler, |
| 43 const base::Closure& report_unrecoverable_error_function, | 43 const base::Closure& report_unrecoverable_error_function, |
| 44 const HttpPostProviderFactoryGetter& http_post_provider_factory_getter, | 44 const HttpPostProviderFactoryGetter& http_post_provider_factory_getter, |
| 45 std::unique_ptr<SyncEncryptionHandler::NigoriState> saved_nigori_state) | 45 std::unique_ptr<SyncEncryptionHandler::NigoriState> saved_nigori_state) |
| 46 override; | 46 override; |
| 47 | 47 |
| 48 void TriggerRefresh(const ModelTypeSet& types) override; | 48 void TriggerRefresh(const ModelTypeSet& types) override; |
| 49 | 49 |
| 50 void UpdateCredentials(const SyncCredentials& credentials) override; | 50 void UpdateCredentials(const SyncCredentials& credentials) override; |
| 51 | 51 |
| 52 void StartSyncingWithServer() override; | 52 void StartSyncingWithServer() override; |
| 53 | 53 |
| 54 void SetEncryptionPassphrase(const std::string& passphrase, | 54 void SetEncryptionPassphrase(const std::string& passphrase, |
| 55 bool is_explicit) override; | 55 bool is_explicit) override; |
| 56 | 56 |
| 57 bool SetDecryptionPassphrase(const std::string& passphrase) override; | 57 bool SetDecryptionPassphrase(const std::string& passphrase) override; |
| 58 | 58 |
| 59 void StopSyncingForShutdown() override; | 59 void StopSyncingForShutdown() override; |
| 60 | 60 |
| 61 std::unique_ptr<base::Thread> Shutdown(ShutdownReason reason) override; | 61 void Shutdown(ShutdownReason reason) override; |
| 62 | 62 |
| 63 void UnregisterInvalidationIds() override; | 63 void UnregisterInvalidationIds() override; |
| 64 | 64 |
| 65 ModelTypeSet ConfigureDataTypes( | 65 ModelTypeSet ConfigureDataTypes( |
| 66 ConfigureReason reason, | 66 ConfigureReason reason, |
| 67 const DataTypeConfigStateMap& config_state_map, | 67 const DataTypeConfigStateMap& config_state_map, |
| 68 const base::Callback<void(ModelTypeSet, ModelTypeSet)>& ready_task, | 68 const base::Callback<void(ModelTypeSet, ModelTypeSet)>& ready_task, |
| 69 const base::Callback<void()>& retry_callback) override; | 69 const base::Callback<void()>& retry_callback) override; |
| 70 | 70 |
| 71 void EnableEncryptEverything() override; | 71 void EnableEncryptEverything() override; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 98 void GetModelSafeRoutingInfo(ModelSafeRoutingInfo* out) const override; | 98 void GetModelSafeRoutingInfo(ModelSafeRoutingInfo* out) const override; |
| 99 | 99 |
| 100 void FlushDirectory() const override; | 100 void FlushDirectory() const override; |
| 101 | 101 |
| 102 void RequestBufferedProtocolEventsAndEnableForwarding() override; | 102 void RequestBufferedProtocolEventsAndEnableForwarding() override; |
| 103 void DisableProtocolEventForwarding() override; | 103 void DisableProtocolEventForwarding() override; |
| 104 | 104 |
| 105 void EnableDirectoryTypeDebugInfoForwarding() override; | 105 void EnableDirectoryTypeDebugInfoForwarding() override; |
| 106 void DisableDirectoryTypeDebugInfoForwarding() override; | 106 void DisableDirectoryTypeDebugInfoForwarding() override; |
| 107 | 107 |
| 108 base::MessageLoop* GetSyncLoopForTesting() override; | |
| 109 | |
| 110 void RefreshTypesForTest(ModelTypeSet types) override; | 108 void RefreshTypesForTest(ModelTypeSet types) override; |
| 111 | 109 |
| 112 void ClearServerData( | 110 void ClearServerData( |
| 113 const SyncManager::ClearServerDataCallback& callback) override; | 111 const SyncManager::ClearServerDataCallback& callback) override; |
| 114 | 112 |
| 115 void OnCookieJarChanged(bool account_mismatch, bool empty_jar) override; | 113 void OnCookieJarChanged(bool account_mismatch, bool empty_jar) override; |
| 116 | 114 |
| 117 void set_fail_initial_download(bool should_fail); | 115 void set_fail_initial_download(bool should_fail); |
| 118 | 116 |
| 119 private: | 117 private: |
| 120 bool fail_initial_download_; | 118 bool fail_initial_download_; |
| 121 }; | 119 }; |
| 122 | 120 |
| 123 } // namespace syncer | 121 } // namespace syncer |
| 124 | 122 |
| 125 #endif // COMPONENTS_SYNC_DRIVER_GLUE_SYNC_BACKEND_HOST_MOCK_H_ | 123 #endif // COMPONENTS_SYNC_DRIVER_GLUE_SYNC_BACKEND_HOST_MOCK_H_ |
| OLD | NEW |