| 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_PROXY_H_ | 5 #ifndef SYNC_TEST_ENGINE_MOCK_MODEL_TYPE_SYNC_PROXY_H_ |
| 6 #define SYNC_TEST_ENGINE_MOCK_MODEL_TYPE_SYNC_PROXY_H_ | 6 #define SYNC_TEST_ENGINE_MOCK_MODEL_TYPE_SYNC_PROXY_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 // It keeps a log of all received messages so tests can make assertions based | 26 // It keeps a log of all received messages so tests can make assertions based |
| 27 // on their value. | 27 // on their value. |
| 28 class MockModelTypeSyncProxy : public ModelTypeSyncProxy { | 28 class MockModelTypeSyncProxy : public ModelTypeSyncProxy { |
| 29 public: | 29 public: |
| 30 MockModelTypeSyncProxy(); | 30 MockModelTypeSyncProxy(); |
| 31 virtual ~MockModelTypeSyncProxy(); | 31 virtual ~MockModelTypeSyncProxy(); |
| 32 | 32 |
| 33 // Implementation of ModelTypeSyncProxy. | 33 // Implementation of ModelTypeSyncProxy. |
| 34 virtual void OnCommitCompleted( | 34 virtual void OnCommitCompleted( |
| 35 const DataTypeState& type_state, | 35 const DataTypeState& type_state, |
| 36 const CommitResponseDataList& response_list) OVERRIDE; | 36 const CommitResponseDataList& response_list) override; |
| 37 virtual void OnUpdateReceived( | 37 virtual void OnUpdateReceived( |
| 38 const DataTypeState& type_state, | 38 const DataTypeState& type_state, |
| 39 const UpdateResponseDataList& response_list, | 39 const UpdateResponseDataList& response_list, |
| 40 const UpdateResponseDataList& pending_updates) OVERRIDE; | 40 const UpdateResponseDataList& pending_updates) override; |
| 41 | 41 |
| 42 // By default, this object behaves as if all messages are processed | 42 // By default, this object behaves as if all messages are processed |
| 43 // immediately. Sometimes it is useful to defer work until later, as might | 43 // immediately. Sometimes it is useful to defer work until later, as might |
| 44 // happen in the real world if the model thread's task queue gets backed up. | 44 // happen in the real world if the model thread's task queue gets backed up. |
| 45 void SetSynchronousExecution(bool is_synchronous); | 45 void SetSynchronousExecution(bool is_synchronous); |
| 46 | 46 |
| 47 // Runs any work that was deferred while this class was in asynchronous mode. | 47 // Runs any work that was deferred while this class was in asynchronous mode. |
| 48 // | 48 // |
| 49 // This function is not useful unless this object is set to synchronous | 49 // This function is not useful unless this object is set to synchronous |
| 50 // execution mode, which is the default. | 50 // execution mode, which is the default. |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 std::map<const std::string, int64> sequence_numbers_; | 131 std::map<const std::string, int64> sequence_numbers_; |
| 132 std::map<const std::string, int64> base_versions_; | 132 std::map<const std::string, int64> base_versions_; |
| 133 std::map<const std::string, std::string> assigned_ids_; | 133 std::map<const std::string, std::string> assigned_ids_; |
| 134 | 134 |
| 135 DISALLOW_COPY_AND_ASSIGN(MockModelTypeSyncProxy); | 135 DISALLOW_COPY_AND_ASSIGN(MockModelTypeSyncProxy); |
| 136 }; | 136 }; |
| 137 | 137 |
| 138 } // namespace syncer | 138 } // namespace syncer |
| 139 | 139 |
| 140 #endif // SYNC_TEST_ENGINE_MOCK_MODEL_TYPE_SYNC_PROXY_H_ | 140 #endif // SYNC_TEST_ENGINE_MOCK_MODEL_TYPE_SYNC_PROXY_H_ |
| OLD | NEW |