OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "sync/internal_api/public/test/fake_sync_manager.h" | 5 #include "sync/internal_api/public/test/fake_sync_manager.h" |
6 | 6 |
7 #include <cstddef> | 7 #include <cstddef> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
48 downloaded_types_.Clear(); | 48 downloaded_types_.Clear(); |
49 return downloaded_types; | 49 return downloaded_types; |
50 } | 50 } |
51 | 51 |
52 ModelTypeSet FakeSyncManager::GetAndResetEnabledTypes() { | 52 ModelTypeSet FakeSyncManager::GetAndResetEnabledTypes() { |
53 ModelTypeSet enabled_types = enabled_types_; | 53 ModelTypeSet enabled_types = enabled_types_; |
54 enabled_types_.Clear(); | 54 enabled_types_.Clear(); |
55 return enabled_types; | 55 return enabled_types; |
56 } | 56 } |
57 | 57 |
58 void FakeSyncManager::Invalidate( | 58 void FakeSyncManager::Invalidate(const ObjectIdPayloadMap& id_payloads, |
59 const ObjectIdPayloadMap& id_payloads, | 59 IncomingNotificationSource source) { |
60 IncomingNotificationSource source) { | |
61 if (!sync_task_runner_->PostTask( | 60 if (!sync_task_runner_->PostTask( |
62 FROM_HERE, | 61 FROM_HERE, |
63 base::Bind(&FakeSyncManager::InvalidateOnSyncThread, | 62 base::Bind(&FakeSyncManager::InvalidateOnSyncThread, |
64 base::Unretained(this), id_payloads, source))) { | 63 base::Unretained(this), id_payloads, source))) { |
65 NOTREACHED(); | 64 NOTREACHED(); |
66 } | 65 } |
67 } | 66 } |
68 | 67 |
69 void FakeSyncManager::EnableNotifications() { | 68 void FakeSyncManager::EnableNotifications() { |
70 if (!sync_task_runner_->PostTask( | 69 if (!sync_task_runner_->PostTask( |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
144 | 143 |
145 void FakeSyncManager::UpdateCredentials(const SyncCredentials& credentials) { | 144 void FakeSyncManager::UpdateCredentials(const SyncCredentials& credentials) { |
146 NOTIMPLEMENTED(); | 145 NOTIMPLEMENTED(); |
147 } | 146 } |
148 | 147 |
149 void FakeSyncManager::UpdateEnabledTypes(const ModelTypeSet& types) { | 148 void FakeSyncManager::UpdateEnabledTypes(const ModelTypeSet& types) { |
150 enabled_types_ = types; | 149 enabled_types_ = types; |
151 } | 150 } |
152 | 151 |
153 void FakeSyncManager::UpdateRegisteredInvalidationIds( | 152 void FakeSyncManager::UpdateRegisteredInvalidationIds( |
154 SyncNotifierObserver* handler, const ObjectIdSet& ids) { | 153 SyncNotifierObserver* handler, |
154 const ObjectIdSet& ids) { | |
155 notifier_helper_.UpdateRegisteredIds(handler, ids); | 155 notifier_helper_.UpdateRegisteredIds(handler, ids); |
156 } | 156 } |
157 | 157 |
158 void FakeSyncManager::StartSyncingNormally( | 158 void FakeSyncManager::StartSyncingNormally( |
159 const ModelSafeRoutingInfo& routing_info) { | 159 const ModelSafeRoutingInfo& routing_info) { |
160 // Do nothing. | 160 // Do nothing. |
161 } | 161 } |
162 | 162 |
163 void FakeSyncManager::SetEncryptionPassphrase(const std::string& passphrase, | 163 void FakeSyncManager::SetEncryptionPassphrase(const std::string& passphrase, |
164 bool is_explicit) { | 164 bool is_explicit) { |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
222 | 222 |
223 bool FakeSyncManager::GetKeystoreKeyBootstrapToken(std::string* token) { | 223 bool FakeSyncManager::GetKeystoreKeyBootstrapToken(std::string* token) { |
224 return false; | 224 return false; |
225 } | 225 } |
226 | 226 |
227 void FakeSyncManager::SaveChanges() { | 227 void FakeSyncManager::SaveChanges() { |
228 // Do nothing. | 228 // Do nothing. |
229 } | 229 } |
230 | 230 |
231 void FakeSyncManager::StopSyncingForShutdown(const base::Closure& callback) { | 231 void FakeSyncManager::StopSyncingForShutdown(const base::Closure& callback) { |
232 if (!sync_task_runner_->PostTask(FROM_HERE, callback)) { | 232 if (!sync_task_runner_->PostTask(FROM_HERE, callback)) { |
akalin
2012/08/03 20:08:49
Prefer to be consistent with the other posts.
| |
233 NOTREACHED(); | 233 NOTREACHED(); |
234 } | 234 } |
235 } | 235 } |
236 | 236 |
237 void FakeSyncManager::ShutdownOnSyncThread() { | 237 void FakeSyncManager::ShutdownOnSyncThread() { |
238 DCHECK(sync_task_runner_->RunsTasksOnCurrentThread()); | 238 DCHECK(sync_task_runner_->RunsTasksOnCurrentThread()); |
239 } | 239 } |
240 | 240 |
241 UserShare* FakeSyncManager::GetUserShare() { | 241 UserShare* FakeSyncManager::GetUserShare() { |
242 NOTIMPLEMENTED(); | 242 NOTIMPLEMENTED(); |
(...skipping 30 matching lines...) Expand all Loading... | |
273 notifier_helper_.EmitOnNotificationsEnabled(); | 273 notifier_helper_.EmitOnNotificationsEnabled(); |
274 } | 274 } |
275 | 275 |
276 void FakeSyncManager::DisableNotificationsOnSyncThread( | 276 void FakeSyncManager::DisableNotificationsOnSyncThread( |
277 NotificationsDisabledReason reason) { | 277 NotificationsDisabledReason reason) { |
278 DCHECK(sync_task_runner_->RunsTasksOnCurrentThread()); | 278 DCHECK(sync_task_runner_->RunsTasksOnCurrentThread()); |
279 notifier_helper_.EmitOnNotificationsDisabled(reason); | 279 notifier_helper_.EmitOnNotificationsDisabled(reason); |
280 } | 280 } |
281 | 281 |
282 } // namespace syncer | 282 } // namespace syncer |
OLD | NEW |