Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(119)

Side by Side Diff: components/sync/engine/fake_sync_engine.cc

Issue 2533083002: [Sync] SyncEngine refactor part 1: interfaces. (Closed)
Patch Set: Rebase. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "components/sync/engine/fake_sync_engine.h"
6
7 #include "components/sync/engine/activation_context.h"
8 #include "components/sync/engine/sync_engine_host.h"
9
10 namespace syncer {
11
12 const char kTestCacheGuid[] = "test-guid";
13
14 FakeSyncEngine::FakeSyncEngine() : fail_initial_download_(false) {}
15 FakeSyncEngine::~FakeSyncEngine() {}
16
17 void FakeSyncEngine::Initialize(
18 SyncEngineHost* host,
19 scoped_refptr<base::SingleThreadTaskRunner> sync_task_runner,
20 const WeakHandle<JsEventHandler>& event_handler,
21 const GURL& service_url,
22 const std::string& sync_user_agent,
23 const SyncCredentials& credentials,
24 bool delete_sync_data_folder,
25 bool enable_local_sync_backend,
26 const base::FilePath& local_sync_backend_folder,
27 std::unique_ptr<SyncManagerFactory> sync_manager_factory,
28 const WeakHandle<UnrecoverableErrorHandler>& unrecoverable_error_handler,
29 const base::Closure& report_unrecoverable_error_function,
30 const HttpPostProviderFactoryGetter& http_post_provider_factory_getter,
31 std::unique_ptr<SyncEncryptionHandler::NigoriState> saved_nigori_state) {
32 host->OnBackendInitialized(WeakHandle<JsBackend>(),
33 WeakHandle<DataTypeDebugInfoListener>(),
34 kTestCacheGuid, !fail_initial_download_);
35 }
36
37 void FakeSyncEngine::TriggerRefresh(const ModelTypeSet& types) {}
38
39 void FakeSyncEngine::UpdateCredentials(const SyncCredentials& credentials) {}
40
41 void FakeSyncEngine::StartSyncingWithServer() {}
42
43 void FakeSyncEngine::SetEncryptionPassphrase(const std::string& passphrase,
44 bool is_explicit) {}
45
46 bool FakeSyncEngine::SetDecryptionPassphrase(const std::string& passphrase) {
47 return false;
48 }
49
50 void FakeSyncEngine::StopSyncingForShutdown() {}
51
52 void FakeSyncEngine::Shutdown(ShutdownReason reason) {}
53
54 void FakeSyncEngine::UnregisterInvalidationIds() {}
55
56 ModelTypeSet FakeSyncEngine::ConfigureDataTypes(
57 ConfigureReason reason,
58 const DataTypeConfigStateMap& config_state_map,
59 const base::Callback<void(ModelTypeSet, ModelTypeSet)>& ready_task,
60 const base::Callback<void()>& retry_callback) {
61 return ModelTypeSet();
62 }
63
64 void FakeSyncEngine::EnableEncryptEverything() {}
65
66 void FakeSyncEngine::ActivateDirectoryDataType(
67 ModelType type,
68 ModelSafeGroup group,
69 ChangeProcessor* change_processor) {}
70 void FakeSyncEngine::DeactivateDirectoryDataType(ModelType type) {}
71
72 void FakeSyncEngine::ActivateNonBlockingDataType(
73 ModelType type,
74 std::unique_ptr<ActivationContext> activation_context) {}
75
76 void FakeSyncEngine::DeactivateNonBlockingDataType(ModelType type) {}
77
78 UserShare* FakeSyncEngine::GetUserShare() const {
79 return nullptr;
80 }
81
82 SyncEngine::Status FakeSyncEngine::GetDetailedStatus() {
83 return SyncEngine::Status();
84 }
85
86 SyncCycleSnapshot FakeSyncEngine::GetLastCycleSnapshot() const {
87 return SyncCycleSnapshot();
88 }
89
90 bool FakeSyncEngine::HasUnsyncedItems() const {
91 return false;
92 }
93
94 bool FakeSyncEngine::IsNigoriEnabled() const {
95 return true;
96 }
97
98 PassphraseType FakeSyncEngine::GetPassphraseType() const {
99 return PassphraseType::IMPLICIT_PASSPHRASE;
100 }
101
102 base::Time FakeSyncEngine::GetExplicitPassphraseTime() const {
103 return base::Time();
104 }
105
106 bool FakeSyncEngine::IsCryptographerReady(const BaseTransaction* trans) const {
107 return false;
108 }
109
110 void FakeSyncEngine::GetModelSafeRoutingInfo(ModelSafeRoutingInfo* out) const {}
111
112 void FakeSyncEngine::FlushDirectory() const {}
113
114 void FakeSyncEngine::RefreshTypesForTest(ModelTypeSet types) {}
115
116 void FakeSyncEngine::RequestBufferedProtocolEventsAndEnableForwarding() {}
117
118 void FakeSyncEngine::DisableProtocolEventForwarding() {}
119
120 void FakeSyncEngine::EnableDirectoryTypeDebugInfoForwarding() {}
121
122 void FakeSyncEngine::DisableDirectoryTypeDebugInfoForwarding() {}
123
124 void FakeSyncEngine::set_fail_initial_download(bool should_fail) {
125 fail_initial_download_ = should_fail;
126 }
127
128 void FakeSyncEngine::ClearServerData(
129 const SyncManager::ClearServerDataCallback& callback) {
130 callback.Run();
131 }
132
133 void FakeSyncEngine::OnCookieJarChanged(bool account_mismatch, bool empty_jar) {
134 }
135
136 } // namespace syncer
OLDNEW
« no previous file with comments | « components/sync/engine/fake_sync_engine.h ('k') | components/sync/engine/model_type_configurer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698