| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_TEST_ENGINE_MOCK_MODEL_TYPE_PROCESSOR_H_ | 5 #ifndef COMPONENTS_SYNC_TEST_ENGINE_MOCK_MODEL_TYPE_PROCESSOR_H_ |
| 6 #define COMPONENTS_SYNC_TEST_ENGINE_MOCK_MODEL_TYPE_PROCESSOR_H_ | 6 #define COMPONENTS_SYNC_TEST_ENGINE_MOCK_MODEL_TYPE_PROCESSOR_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 #include <map> | 11 #include <map> |
| 12 #include <memory> | 12 #include <memory> |
| 13 #include <string> | 13 #include <string> |
| 14 #include <vector> | 14 #include <vector> |
| 15 | 15 |
| 16 #include "base/callback.h" | 16 #include "base/callback.h" |
| 17 #include "base/macros.h" | 17 #include "base/macros.h" |
| 18 #include "components/sync/core/model_type_processor.h" | 18 #include "components/sync/core/model_type_processor.h" |
| 19 #include "components/sync/core/non_blocking_sync_common.h" | 19 #include "components/sync/core/non_blocking_sync_common.h" |
| 20 #include "components/sync/protocol/data_type_state.pb.h" | 20 #include "components/sync/protocol/data_type_state.pb.h" |
| 21 | 21 |
| 22 namespace syncer { | 22 namespace syncer_v2 { |
| 23 | 23 |
| 24 // Mocks the ModelTypeProcessor. | 24 // Mocks the ModelTypeProcessor. |
| 25 // | 25 // |
| 26 // This mock is made simpler by not using any threads. It does still have the | 26 // This mock is made simpler by not using any threads. It does still have the |
| 27 // ability to defer execution if we need to test race conditions, though. | 27 // ability to defer execution if we need to test race conditions, though. |
| 28 // | 28 // |
| 29 // It maintains some state to try to make its behavior more realistic. It | 29 // It maintains some state to try to make its behavior more realistic. It |
| 30 // updates this state as it creates commit requests or receives update and | 30 // updates this state as it creates commit requests or receives update and |
| 31 // commit responses. | 31 // commit responses. |
| 32 // | 32 // |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 std::map<const std::string, int64_t> sequence_numbers_; | 139 std::map<const std::string, int64_t> sequence_numbers_; |
| 140 std::map<const std::string, int64_t> base_versions_; | 140 std::map<const std::string, int64_t> base_versions_; |
| 141 std::map<const std::string, std::string> assigned_ids_; | 141 std::map<const std::string, std::string> assigned_ids_; |
| 142 | 142 |
| 143 // Callback which will be call during disconnection | 143 // Callback which will be call during disconnection |
| 144 DisconnectCallback disconnect_callback_; | 144 DisconnectCallback disconnect_callback_; |
| 145 | 145 |
| 146 DISALLOW_COPY_AND_ASSIGN(MockModelTypeProcessor); | 146 DISALLOW_COPY_AND_ASSIGN(MockModelTypeProcessor); |
| 147 }; | 147 }; |
| 148 | 148 |
| 149 } // namespace syncer | 149 } // namespace syncer_v2 |
| 150 | 150 |
| 151 #endif // COMPONENTS_SYNC_TEST_ENGINE_MOCK_MODEL_TYPE_PROCESSOR_H_ | 151 #endif // COMPONENTS_SYNC_TEST_ENGINE_MOCK_MODEL_TYPE_PROCESSOR_H_ |
| OLD | NEW |