| 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 #ifndef CHROME_BROWSER_SYNC_API_SYNCABLE_SERVICE_FAKE_H_ |
| 6 #define CHROME_BROWSER_SYNC_API_SYNCABLE_SERVICE_FAKE_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "chrome/browser/sync/api/syncable_service.h" |
| 10 |
| 11 // A fake SyncableService that can return arbitrary values and maintains the |
| 12 // syncing status. |
| 13 class SyncableServiceFake : public SyncableService { |
| 14 public: |
| 15 SyncableServiceFake(); |
| 16 virtual ~SyncableServiceFake(); |
| 17 |
| 18 // Reset the SyncableService results. |
| 19 void Reset(); |
| 20 |
| 21 // Setters for SyncableService implementation results. |
| 22 // Whether to return an error for MergeDataAndStartSyncing. |
| 23 void set_associate_success(bool success); |
| 24 // Whether to return an error for ProcessSyncChanges. |
| 25 void set_process_success(bool success); |
| 26 |
| 27 // Whether we're syncing or not. Set on a successful MergeDataAndStartSyncing, |
| 28 // reset on StopSyncing. False by default. |
| 29 bool syncing() const; |
| 30 |
| 31 // SyncableService implementation. |
| 32 virtual SyncError MergeDataAndStartSyncing( |
| 33 syncable::ModelType type, |
| 34 const SyncDataList& initial_sync_data, |
| 35 SyncChangeProcessor* sync_processor) OVERRIDE; |
| 36 virtual void StopSyncing(syncable::ModelType type) OVERRIDE; |
| 37 virtual SyncDataList GetAllSyncData(syncable::ModelType type) const OVERRIDE; |
| 38 virtual SyncError ProcessSyncChanges( |
| 39 const tracked_objects::Location& from_here, |
| 40 const SyncChangeList& change_list) OVERRIDE; |
| 41 |
| 42 private: |
| 43 scoped_ptr<SyncChangeProcessor> sync_processor_; |
| 44 bool associate_success_; |
| 45 bool process_success_; |
| 46 bool syncing_; |
| 47 syncable::ModelType type_; |
| 48 }; |
| 49 |
| 50 #endif // CHROME_BROWSER_SYNC_API_SYNCABLE_SERVICE_FAKE_H_ |
| OLD | NEW |