| 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..9823dbd1b551481c8e88b1efb3d24f268d058ccf
|
| --- /dev/null
|
| +++ b/chrome/browser/sync/api/fake_syncable_service.cc
|
| @@ -0,0 +1,55 @@
|
| +// 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() {}
|
| +
|
| +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_;
|
| +}
|
|
|