Chromium Code Reviews| Index: chrome/browser/sync/api/fake_syncable_service.cc |
| diff --git a/chrome/browser/sync/api/fake_syncable_service.cc b/chrome/browser/sync/api/fake_syncable_service.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..e1c8e38dee573a0c93f1cc168bb551e2991ccddb |
| --- /dev/null |
| +++ b/chrome/browser/sync/api/fake_syncable_service.cc |
| @@ -0,0 +1,54 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "chrome/browser/sync/api/fake_syncable_service.h" |
| + |
| +#include "base/location.h" |
| + |
| +FakeSyncableService::FakeSyncableService() |
| + : syncing_(false), |
| + type_(syncable::UNSPECIFIED) {} |
| +FakeSyncableService::~FakeSyncableService() {} |
|
akalin
2012/03/06 02:33:47
newline before
Nicolas Zea
2012/03/06 18:27:14
Done.
|
| + |
| +void FakeSyncableService::set_merge_data_and_start_syncing_error( |
| + const SyncError& error) { |
| + merge_data_and_start_syncing_error_ = error; |
| +} |
| + |
| +void FakeSyncableService::set_process_sync_changes_error( |
| + const SyncError& error) { |
| + process_sync_changes_error_ = error; |
| +} |
| + |
| +bool FakeSyncableService::syncing() const { |
| + return syncing_; |
| +} |
| + |
| +// SyncableService implementation. |
| +SyncError FakeSyncableService::MergeDataAndStartSyncing( |
| + syncable::ModelType type, |
| + const SyncDataList& initial_sync_data, |
| + SyncChangeProcessor* sync_processor) { |
| + sync_processor_.reset(sync_processor); |
| + type_ = type; |
| + if (!merge_data_and_start_syncing_error_.IsSet()) { |
| + syncing_ = true; |
| + } |
| + return merge_data_and_start_syncing_error_; |
| +} |
| + |
| +void FakeSyncableService::StopSyncing(syncable::ModelType type) { |
| + syncing_ = false; |
| +} |
| + |
| +SyncDataList FakeSyncableService::GetAllSyncData( |
| + syncable::ModelType type) const { |
| + return SyncDataList(); |
| +} |
| + |
| +SyncError FakeSyncableService::ProcessSyncChanges( |
| + const tracked_objects::Location& from_here, |
| + const SyncChangeList& change_list) { |
| + return process_sync_changes_error_; |
| +} |