| 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_ENGINE_FAKE_SYNC_ENGINE_H_ | 5 #ifndef COMPONENTS_SYNC_ENGINE_FAKE_SYNC_ENGINE_H_ |
| 6 #define COMPONENTS_SYNC_ENGINE_FAKE_SYNC_ENGINE_H_ | 6 #define COMPONENTS_SYNC_ENGINE_FAKE_SYNC_ENGINE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "components/sync/base/weak_handle.h" | 13 #include "components/sync/base/weak_handle.h" |
| 14 #include "components/sync/engine/sync_engine.h" | 14 #include "components/sync/engine/sync_engine.h" |
| 15 | 15 |
| 16 namespace syncer { | 16 namespace syncer { |
| 17 | 17 |
| 18 // A mock of the SyncEngine. | 18 // A mock of the SyncEngine. |
| 19 // | 19 // |
| 20 // This class implements the bare minimum required for the ProfileSyncService to | 20 // This class implements the bare minimum required for the ProfileSyncService to |
| 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 SyncEngine | 22 // values; it is not intended to be used in tests that depend on SyncEngine |
| 23 // behavior. | 23 // behavior. |
| 24 class FakeSyncEngine : public SyncEngine { | 24 class FakeSyncEngine : public SyncEngine { |
| 25 public: | 25 public: |
| 26 FakeSyncEngine(); | 26 FakeSyncEngine(); |
| 27 ~FakeSyncEngine() override; | 27 ~FakeSyncEngine() override; |
| 28 | 28 |
| 29 void Initialize( | 29 void Initialize(InitParams params) override; |
| 30 SyncEngineHost* host, | |
| 31 scoped_refptr<base::SingleThreadTaskRunner> sync_task_runner, | |
| 32 const WeakHandle<JsEventHandler>& event_handler, | |
| 33 const GURL& service_url, | |
| 34 const std::string& sync_user_agent, | |
| 35 const SyncCredentials& credentials, | |
| 36 bool delete_sync_data_folder, | |
| 37 bool enable_local_sync_backend, | |
| 38 const base::FilePath& local_sync_backend_folder, | |
| 39 std::unique_ptr<SyncManagerFactory> sync_manager_factory, | |
| 40 const WeakHandle<UnrecoverableErrorHandler>& unrecoverable_error_handler, | |
| 41 const base::Closure& report_unrecoverable_error_function, | |
| 42 const HttpPostProviderFactoryGetter& http_post_provider_factory_getter, | |
| 43 std::unique_ptr<SyncEncryptionHandler::NigoriState> saved_nigori_state) | |
| 44 override; | |
| 45 | 30 |
| 46 void TriggerRefresh(const ModelTypeSet& types) override; | 31 void TriggerRefresh(const ModelTypeSet& types) override; |
| 47 | 32 |
| 48 void UpdateCredentials(const SyncCredentials& credentials) override; | 33 void UpdateCredentials(const SyncCredentials& credentials) override; |
| 49 | 34 |
| 50 void StartSyncingWithServer() override; | 35 void StartSyncingWithServer() override; |
| 51 | 36 |
| 52 void SetEncryptionPassphrase(const std::string& passphrase, | 37 void SetEncryptionPassphrase(const std::string& passphrase, |
| 53 bool is_explicit) override; | 38 bool is_explicit) override; |
| 54 | 39 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 | 97 |
| 113 void set_fail_initial_download(bool should_fail); | 98 void set_fail_initial_download(bool should_fail); |
| 114 | 99 |
| 115 private: | 100 private: |
| 116 bool fail_initial_download_; | 101 bool fail_initial_download_; |
| 117 }; | 102 }; |
| 118 | 103 |
| 119 } // namespace syncer | 104 } // namespace syncer |
| 120 | 105 |
| 121 #endif // COMPONENTS_SYNC_ENGINE_FAKE_SYNC_ENGINE_H_ | 106 #endif // COMPONENTS_SYNC_ENGINE_FAKE_SYNC_ENGINE_H_ |
| OLD | NEW |