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_SYNC_WORKER_H_ | 5 #ifndef SYNC_TEST_ENGINE_MOCK_MODEL_TYPE_SYNC_WORKER_H_ |
6 #define SYNC_TEST_ENGINE_MOCK_MODEL_TYPE_SYNC_WORKER_H_ | 6 #define SYNC_TEST_ENGINE_MOCK_MODEL_TYPE_SYNC_WORKER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "sync/engine/model_type_sync_worker.h" | 11 #include "sync/engine/model_type_sync_worker.h" |
12 #include "sync/internal_api/public/non_blocking_sync_common.h" | 12 #include "sync/internal_api/public/non_blocking_sync_common.h" |
13 | 13 |
14 namespace syncer { | 14 namespace syncer { |
15 | 15 |
16 // Receives and records commit requests sent through the ModelTypeSyncWorker. | 16 // Receives and records commit requests sent through the ModelTypeSyncWorker. |
17 // | 17 // |
18 // This class also includes features intended to help mock out server behavior. | 18 // This class also includes features intended to help mock out server behavior. |
19 // It has some basic functionality to keep track of server state and generate | 19 // It has some basic functionality to keep track of server state and generate |
20 // plausible UpdateResponseData and CommitResponseData messages. | 20 // plausible UpdateResponseData and CommitResponseData messages. |
21 class MockModelTypeSyncWorker : public ModelTypeSyncWorker { | 21 class MockModelTypeSyncWorker : public ModelTypeSyncWorker { |
22 public: | 22 public: |
23 MockModelTypeSyncWorker(); | 23 MockModelTypeSyncWorker(); |
24 virtual ~MockModelTypeSyncWorker(); | 24 virtual ~MockModelTypeSyncWorker(); |
25 | 25 |
26 // Implementation of ModelTypeSyncWorker. | 26 // Implementation of ModelTypeSyncWorker. |
27 virtual void EnqueueForCommit(const CommitRequestDataList& list) OVERRIDE; | 27 virtual void EnqueueForCommit(const CommitRequestDataList& list) override; |
28 | 28 |
29 // Getters to inspect the requests sent to this object. | 29 // Getters to inspect the requests sent to this object. |
30 size_t GetNumCommitRequestLists() const; | 30 size_t GetNumCommitRequestLists() const; |
31 CommitRequestDataList GetNthCommitRequestList(size_t n) const; | 31 CommitRequestDataList GetNthCommitRequestList(size_t n) const; |
32 bool HasCommitRequestForTagHash(const std::string& tag_hash) const; | 32 bool HasCommitRequestForTagHash(const std::string& tag_hash) const; |
33 CommitRequestData GetLatestCommitRequestForTagHash( | 33 CommitRequestData GetLatestCommitRequestForTagHash( |
34 const std::string& tag_hash) const; | 34 const std::string& tag_hash) const; |
35 | 35 |
36 // Functions to produce state as though it came from a real server and had | 36 // Functions to produce state as though it came from a real server and had |
37 // been filtered through a real ModelTypeSyncWorker. | 37 // been filtered through a real ModelTypeSyncWorker. |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 | 79 |
80 // Name of the encryption key in use on other clients. | 80 // Name of the encryption key in use on other clients. |
81 std::string server_encryption_key_name_; | 81 std::string server_encryption_key_name_; |
82 | 82 |
83 DISALLOW_COPY_AND_ASSIGN(MockModelTypeSyncWorker); | 83 DISALLOW_COPY_AND_ASSIGN(MockModelTypeSyncWorker); |
84 }; | 84 }; |
85 | 85 |
86 } // namespace syncer | 86 } // namespace syncer |
87 | 87 |
88 #endif // SYNC_TEST_ENGINE_MOCK_MODEL_TYPE_SYNC_WORKER_H_ | 88 #endif // SYNC_TEST_ENGINE_MOCK_MODEL_TYPE_SYNC_WORKER_H_ |
OLD | NEW |