| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_SYNC_API_MOCK_MODEL_TYPE_STORE_H_ | 5 #ifndef COMPONENTS_SYNC_API_MOCK_MODEL_TYPE_STORE_H_ |
| 6 #define COMPONENTS_SYNC_API_MOCK_MODEL_TYPE_STORE_H_ | 6 #define COMPONENTS_SYNC_API_MOCK_MODEL_TYPE_STORE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 #include "components/sync/api/model_type_store.h" | 11 #include "components/sync/api/model_type_store.h" |
| 12 | 12 |
| 13 namespace syncer_v2 { | 13 namespace syncer { |
| 14 | 14 |
| 15 // MockModelTypeStore is implementation of ModelTypeStore that does nothing. | 15 // MockModelTypeStore is implementation of ModelTypeStore that does nothing. |
| 16 // Use it when testing components that depend on ModelTypeStore. | 16 // Use it when testing components that depend on ModelTypeStore. |
| 17 // | 17 // |
| 18 // By default all methods return SUCCESS and empty results. It is possible to | 18 // By default all methods return SUCCESS and empty results. It is possible to |
| 19 // register custom handlers for certain functions to override behavior. It is | 19 // register custom handlers for certain functions to override behavior. It is |
| 20 // responsibility of handler to post callback with result. | 20 // responsibility of handler to post callback with result. |
| 21 // Here is an example: | 21 // Here is an example: |
| 22 // === | 22 // === |
| 23 // void OnReadData(const ModelTypeStore::IdList& id_list, | 23 // void OnReadData(const ModelTypeStore::IdList& id_list, |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 ReadAllMetadataSignature read_all_metadata_handler_; | 105 ReadAllMetadataSignature read_all_metadata_handler_; |
| 106 CommitWriteBatchSignature commit_write_batch_handler_; | 106 CommitWriteBatchSignature commit_write_batch_handler_; |
| 107 WriteRecordSignature write_data_handler_; | 107 WriteRecordSignature write_data_handler_; |
| 108 WriteRecordSignature write_metadata_handler_; | 108 WriteRecordSignature write_metadata_handler_; |
| 109 WriteGlobalMetadataSignature write_global_metadata_handler_; | 109 WriteGlobalMetadataSignature write_global_metadata_handler_; |
| 110 DeleteRecordSignature delete_data_handler_; | 110 DeleteRecordSignature delete_data_handler_; |
| 111 DeleteRecordSignature delete_metadata_handler_; | 111 DeleteRecordSignature delete_metadata_handler_; |
| 112 DeleteGlobalMetadataSignature delete_global_metadata_handler_; | 112 DeleteGlobalMetadataSignature delete_global_metadata_handler_; |
| 113 }; | 113 }; |
| 114 | 114 |
| 115 } // namespace syncer_v2 | 115 } // namespace syncer |
| 116 | 116 |
| 117 #endif // COMPONENTS_SYNC_API_MOCK_MODEL_TYPE_STORE_H_ | 117 #endif // COMPONENTS_SYNC_API_MOCK_MODEL_TYPE_STORE_H_ |
| OLD | NEW |