| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/sync/api/fake_syncable_service.h" |
| 6 |
| 7 #include "base/location.h" |
| 8 |
| 9 FakeSyncableService::FakeSyncableService() |
| 10 : syncing_(false), |
| 11 type_(syncable::UNSPECIFIED) {} |
| 12 |
| 13 FakeSyncableService::~FakeSyncableService() {} |
| 14 |
| 15 void FakeSyncableService::set_merge_data_and_start_syncing_error( |
| 16 const SyncError& error) { |
| 17 merge_data_and_start_syncing_error_ = error; |
| 18 } |
| 19 |
| 20 void FakeSyncableService::set_process_sync_changes_error( |
| 21 const SyncError& error) { |
| 22 process_sync_changes_error_ = error; |
| 23 } |
| 24 |
| 25 bool FakeSyncableService::syncing() const { |
| 26 return syncing_; |
| 27 } |
| 28 |
| 29 // SyncableService implementation. |
| 30 SyncError FakeSyncableService::MergeDataAndStartSyncing( |
| 31 syncable::ModelType type, |
| 32 const SyncDataList& initial_sync_data, |
| 33 SyncChangeProcessor* sync_processor) { |
| 34 sync_processor_.reset(sync_processor); |
| 35 type_ = type; |
| 36 if (!merge_data_and_start_syncing_error_.IsSet()) { |
| 37 syncing_ = true; |
| 38 } |
| 39 return merge_data_and_start_syncing_error_; |
| 40 } |
| 41 |
| 42 void FakeSyncableService::StopSyncing(syncable::ModelType type) { |
| 43 syncing_ = false; |
| 44 } |
| 45 |
| 46 SyncDataList FakeSyncableService::GetAllSyncData( |
| 47 syncable::ModelType type) const { |
| 48 return SyncDataList(); |
| 49 } |
| 50 |
| 51 SyncError FakeSyncableService::ProcessSyncChanges( |
| 52 const tracked_objects::Location& from_here, |
| 53 const SyncChangeList& change_list) { |
| 54 return process_sync_changes_error_; |
| 55 } |
| OLD | NEW |