| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // Mock ServerConnectionManager class for use in client unit tests. | 5 // Mock ServerConnectionManager class for use in client unit tests. |
| 6 | 6 |
| 7 #ifndef SYNC_TEST_ENGINE_MOCK_CONNECTION_MANAGER_H_ | 7 #ifndef SYNC_TEST_ENGINE_MOCK_CONNECTION_MANAGER_H_ |
| 8 #define SYNC_TEST_ENGINE_MOCK_CONNECTION_MANAGER_H_ | 8 #define SYNC_TEST_ENGINE_MOCK_CONNECTION_MANAGER_H_ |
| 9 #pragma once | 9 #pragma once |
| 10 | 10 |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 void SetChangesRemaining(int64 count); | 114 void SetChangesRemaining(int64 count); |
| 115 | 115 |
| 116 // Add a new batch of updates after the current one. Allows multiple | 116 // Add a new batch of updates after the current one. Allows multiple |
| 117 // GetUpdates responses to be buffered up, since the syncer may | 117 // GetUpdates responses to be buffered up, since the syncer may |
| 118 // issue multiple requests during a sync cycle. | 118 // issue multiple requests during a sync cycle. |
| 119 void NextUpdateBatch(); | 119 void NextUpdateBatch(); |
| 120 | 120 |
| 121 void FailNextPostBufferToPathCall() { countdown_to_postbuffer_fail_ = 1; } | 121 void FailNextPostBufferToPathCall() { countdown_to_postbuffer_fail_ = 1; } |
| 122 void FailNthPostBufferToPathCall(int n) { countdown_to_postbuffer_fail_ = n; } | 122 void FailNthPostBufferToPathCall(int n) { countdown_to_postbuffer_fail_ = n; } |
| 123 | 123 |
| 124 void SetClearUserDataResponseStatus(sync_pb::SyncEnums::ErrorType errortype); | |
| 125 | |
| 126 void FailNonPeriodicGetUpdates() { fail_non_periodic_get_updates_ = true; } | 124 void FailNonPeriodicGetUpdates() { fail_non_periodic_get_updates_ = true; } |
| 127 | 125 |
| 128 // Simple inspectors. | 126 // Simple inspectors. |
| 129 bool client_stuck() const { return client_stuck_; } | 127 bool client_stuck() const { return client_stuck_; } |
| 130 | 128 |
| 131 sync_pb::ClientCommand* GetNextClientCommand(); | 129 sync_pb::ClientCommand* GetNextClientCommand(); |
| 132 | 130 |
| 133 const std::vector<syncable::Id>& committed_ids() const { | 131 const std::vector<syncable::Id>& committed_ids() const { |
| 134 return committed_ids_; | 132 return committed_ids_; |
| 135 } | 133 } |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 int num_get_updates_requests_; | 342 int num_get_updates_requests_; |
| 345 | 343 |
| 346 std::string next_token_; | 344 std::string next_token_; |
| 347 | 345 |
| 348 sync_pb::ClientToServerMessage last_request_; | 346 sync_pb::ClientToServerMessage last_request_; |
| 349 | 347 |
| 350 DISALLOW_COPY_AND_ASSIGN(MockConnectionManager); | 348 DISALLOW_COPY_AND_ASSIGN(MockConnectionManager); |
| 351 }; | 349 }; |
| 352 | 350 |
| 353 #endif // SYNC_TEST_ENGINE_MOCK_CONNECTION_MANAGER_H_ | 351 #endif // SYNC_TEST_ENGINE_MOCK_CONNECTION_MANAGER_H_ |
| OLD | NEW |