| 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_GLUE_FAKE_GENERIC_CHANGE_PROCESSOR_H_ |
| 6 #define CHROME_BROWSER_SYNC_GLUE_FAKE_GENERIC_CHANGE_PROCESSOR_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "chrome/browser/sync/glue/generic_change_processor.h" |
| 10 |
| 11 #include "chrome/browser/sync/api/sync_error.h" |
| 12 |
| 13 namespace browser_sync { |
| 14 |
| 15 // A fake GenericChangeProcessor that can return arbitrary values. |
| 16 class FakeGenericChangeProcessor : public GenericChangeProcessor { |
| 17 public: |
| 18 FakeGenericChangeProcessor(); |
| 19 virtual ~FakeGenericChangeProcessor(); |
| 20 |
| 21 // Setters for GenericChangeProcessor implementation results. |
| 22 void set_process_sync_changes_error(const SyncError& error); |
| 23 void set_get_sync_data_for_type_error(const SyncError& error); |
| 24 void set_sync_model_has_user_created_nodes(bool has_nodes); |
| 25 void set_sync_model_has_user_created_nodes_success(bool success); |
| 26 void set_crypto_ready_if_necessary(bool crypto_ready); |
| 27 |
| 28 // GenericChangeProcessor implementations. |
| 29 virtual SyncError ProcessSyncChanges( |
| 30 const tracked_objects::Location& from_here, |
| 31 const SyncChangeList& change_list) OVERRIDE; |
| 32 virtual SyncError GetSyncDataForType( |
| 33 syncable::ModelType type, SyncDataList* current_sync_data) OVERRIDE; |
| 34 virtual bool SyncModelHasUserCreatedNodes(syncable::ModelType type, |
| 35 bool* has_nodes) OVERRIDE; |
| 36 virtual bool CryptoReadyIfNecessary(syncable::ModelType type) OVERRIDE; |
| 37 |
| 38 private: |
| 39 SyncError process_sync_changes_error_; |
| 40 SyncError get_sync_data_for_type_error_; |
| 41 bool sync_model_has_user_created_nodes_; |
| 42 bool sync_model_has_user_created_nodes_success_; |
| 43 bool crypto_ready_if_necessary_; |
| 44 syncable::ModelType type_; |
| 45 }; |
| 46 |
| 47 } // namespace browser_sync |
| 48 |
| 49 #endif // CHROME_BROWSER_SYNC_GLUE_FAKE_GENERIC_CHANGE_PROCESSOR_H_ |
| OLD | NEW |