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 |
(...skipping 17 matching lines...) Expand all Loading... |
28 // ability to defer execution if we need to test race conditions, though. | 28 // ability to defer execution if we need to test race conditions, though. |
29 // | 29 // |
30 // It maintains some state to try to make its behavior more realistic. It | 30 // It maintains some state to try to make its behavior more realistic. It |
31 // updates this state as it creates commit requests or receives update and | 31 // updates this state as it creates commit requests or receives update and |
32 // commit responses. | 32 // commit responses. |
33 // | 33 // |
34 // It keeps a log of all received messages so tests can make assertions based | 34 // It keeps a log of all received messages so tests can make assertions based |
35 // on their value. | 35 // on their value. |
36 class MockModelTypeProcessor : public ModelTypeProcessor { | 36 class MockModelTypeProcessor : public ModelTypeProcessor { |
37 public: | 37 public: |
38 typedef base::Callback<void()> DisconnectCallback; | 38 using DisconnectCallback = base::Callback<void()>; |
39 | 39 |
40 MockModelTypeProcessor(); | 40 MockModelTypeProcessor(); |
41 ~MockModelTypeProcessor() override; | 41 ~MockModelTypeProcessor() override; |
42 | 42 |
43 // Implementation of ModelTypeProcessor. | 43 // Implementation of ModelTypeProcessor. |
44 void ConnectSync(std::unique_ptr<CommitQueue> commit_queue) override; | 44 void ConnectSync(std::unique_ptr<CommitQueue> commit_queue) override; |
45 void DisconnectSync() override; | 45 void DisconnectSync() override; |
46 void OnCommitCompleted(const sync_pb::ModelTypeState& type_state, | 46 void OnCommitCompleted(const sync_pb::ModelTypeState& type_state, |
47 const CommitResponseDataList& response_list) override; | 47 const CommitResponseDataList& response_list) override; |
48 void OnUpdateReceived(const sync_pb::ModelTypeState& type_state, | 48 void OnUpdateReceived(const sync_pb::ModelTypeState& type_state, |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 | 147 |
148 // Callback which will be call during disconnection | 148 // Callback which will be call during disconnection |
149 DisconnectCallback disconnect_callback_; | 149 DisconnectCallback disconnect_callback_; |
150 | 150 |
151 DISALLOW_COPY_AND_ASSIGN(MockModelTypeProcessor); | 151 DISALLOW_COPY_AND_ASSIGN(MockModelTypeProcessor); |
152 }; | 152 }; |
153 | 153 |
154 } // namespace syncer | 154 } // namespace syncer |
155 | 155 |
156 #endif // COMPONENTS_SYNC_TEST_ENGINE_MOCK_MODEL_TYPE_PROCESSOR_H_ | 156 #endif // COMPONENTS_SYNC_TEST_ENGINE_MOCK_MODEL_TYPE_PROCESSOR_H_ |
OLD | NEW |