| Index: chrome/browser/sync/api/syncable_service_fake.cc
|
| diff --git a/chrome/browser/sync/api/syncable_service_fake.cc b/chrome/browser/sync/api/syncable_service_fake.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..74cd397f6a2ac6cfba7a6e6135a10df7b61bbe27
|
| --- /dev/null
|
| +++ b/chrome/browser/sync/api/syncable_service_fake.cc
|
| @@ -0,0 +1,60 @@
|
| +// 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/syncable_service_fake.h"
|
| +
|
| +#include "base/location.h"
|
| +
|
| +SyncableServiceFake::SyncableServiceFake() { Reset(); }
|
| +SyncableServiceFake::~SyncableServiceFake() {}
|
| +
|
| +void SyncableServiceFake::Reset() {
|
| + associate_success_ = true;
|
| + process_success_ = true;
|
| + syncing_ = false;
|
| + type_ = syncable::UNSPECIFIED;
|
| +}
|
| +
|
| +void SyncableServiceFake::set_associate_success(bool success) {
|
| + associate_success_ = success;
|
| +}
|
| +
|
| +void SyncableServiceFake::set_process_success(bool success) {
|
| + process_success_ = success;
|
| +}
|
| +
|
| +bool SyncableServiceFake::syncing() const {
|
| + return syncing_;
|
| +}
|
| +
|
| +// SyncableService implementation.
|
| +SyncError SyncableServiceFake::MergeDataAndStartSyncing(
|
| + syncable::ModelType type,
|
| + const SyncDataList& initial_sync_data,
|
| + SyncChangeProcessor* sync_processor) {
|
| + sync_processor_.reset(sync_processor);
|
| + type_ = type;
|
| + if (associate_success_) {
|
| + syncing_ = true;
|
| + return SyncError();
|
| + }
|
| + return SyncError(FROM_HERE, "Associate Error", type_);
|
| +}
|
| +
|
| +void SyncableServiceFake::StopSyncing(syncable::ModelType type) {
|
| + syncing_ = false;
|
| +}
|
| +
|
| +SyncDataList SyncableServiceFake::GetAllSyncData(
|
| + syncable::ModelType type) const {
|
| + return SyncDataList();
|
| +}
|
| +
|
| +SyncError SyncableServiceFake::ProcessSyncChanges(
|
| + const tracked_objects::Location& from_here,
|
| + const SyncChangeList& change_list) {
|
| + if (process_success_)
|
| + return SyncError();
|
| + return SyncError(FROM_HERE, "Process Error", type_);
|
| +}
|
|
|