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 SYNC_TEST_ENGINE_MOCK_MODEL_TYPE_WORKER_H_ | 5 #ifndef COMPONENTS_SYNC_TEST_ENGINE_MOCK_MODEL_TYPE_WORKER_H_ |
6 #define SYNC_TEST_ENGINE_MOCK_MODEL_TYPE_WORKER_H_ | 6 #define COMPONENTS_SYNC_TEST_ENGINE_MOCK_MODEL_TYPE_WORKER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
11 #include <deque> | 11 #include <deque> |
12 #include <map> | 12 #include <map> |
13 #include <string> | 13 #include <string> |
14 #include <vector> | 14 #include <vector> |
15 | 15 |
16 #include "base/macros.h" | 16 #include "base/macros.h" |
17 #include "sync/engine/commit_queue.h" | 17 #include "components/sync/core/model_type_processor.h" |
18 #include "sync/internal_api/public/model_type_processor.h" | 18 #include "components/sync/core/non_blocking_sync_common.h" |
19 #include "sync/internal_api/public/non_blocking_sync_common.h" | 19 #include "components/sync/engine_impl/commit_queue.h" |
20 #include "sync/protocol/data_type_state.pb.h" | 20 #include "components/sync/protocol/data_type_state.pb.h" |
21 | 21 |
22 namespace syncer_v2 { | 22 namespace syncer_v2 { |
23 | 23 |
24 // Receives and records commit requests sent through the ModelTypeWorker. | 24 // Receives and records commit requests sent through the ModelTypeWorker. |
25 // | 25 // |
26 // This class also includes features intended to help mock out server behavior. | 26 // This class also includes features intended to help mock out server behavior. |
27 // It has some basic functionality to keep track of server state and generate | 27 // It has some basic functionality to keep track of server state and generate |
28 // plausible UpdateResponseData and CommitResponseData messages. | 28 // plausible UpdateResponseData and CommitResponseData messages. |
29 class MockModelTypeWorker : public CommitQueue { | 29 class MockModelTypeWorker : public CommitQueue { |
30 public: | 30 public: |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 | 113 |
114 // Map of versions by client tag. | 114 // Map of versions by client tag. |
115 // This is an essential part of the mocked server state. | 115 // This is an essential part of the mocked server state. |
116 std::map<const std::string, int64_t> server_versions_; | 116 std::map<const std::string, int64_t> server_versions_; |
117 | 117 |
118 DISALLOW_COPY_AND_ASSIGN(MockModelTypeWorker); | 118 DISALLOW_COPY_AND_ASSIGN(MockModelTypeWorker); |
119 }; | 119 }; |
120 | 120 |
121 } // namespace syncer_v2 | 121 } // namespace syncer_v2 |
122 | 122 |
123 #endif // SYNC_TEST_ENGINE_MOCK_MODEL_TYPE_WORKER_H_ | 123 #endif // COMPONENTS_SYNC_TEST_ENGINE_MOCK_MODEL_TYPE_WORKER_H_ |
OLD | NEW |