OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_BROWSER_SYNC_TEST_ENGINE_MOCK_CONNECTION_MANAGER_H_ | 7 #ifndef CHROME_BROWSER_SYNC_TEST_ENGINE_MOCK_CONNECTION_MANAGER_H_ |
8 #define CHROME_BROWSER_SYNC_TEST_ENGINE_MOCK_CONNECTION_MANAGER_H_ | 8 #define CHROME_BROWSER_SYNC_TEST_ENGINE_MOCK_CONNECTION_MANAGER_H_ |
9 #pragma once | 9 #pragma once |
10 | 10 |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 // the syncer. | 200 // the syncer. |
201 int GetAndClearNumGetUpdatesRequests() { | 201 int GetAndClearNumGetUpdatesRequests() { |
202 int result = num_get_updates_requests_; | 202 int result = num_get_updates_requests_; |
203 num_get_updates_requests_ = 0; | 203 num_get_updates_requests_ = 0; |
204 return result; | 204 return result; |
205 } | 205 } |
206 | 206 |
207 // Expect that GetUpdates will request exactly the types indicated in | 207 // Expect that GetUpdates will request exactly the types indicated in |
208 // the bitset. | 208 // the bitset. |
209 void ExpectGetUpdatesRequestTypes( | 209 void ExpectGetUpdatesRequestTypes( |
210 syncable::ModelEnumSet expected_filter) { | 210 syncable::ModelTypeSet expected_filter) { |
211 expected_filter_ = expected_filter; | 211 expected_filter_ = expected_filter; |
212 } | 212 } |
213 | 213 |
214 void ExpectGetUpdatesRequestPayloads( | 214 void ExpectGetUpdatesRequestPayloads( |
215 const syncable::ModelTypePayloadMap& payloads) { | 215 const syncable::ModelTypePayloadMap& payloads) { |
216 expected_payloads_ = payloads; | 216 expected_payloads_ = payloads; |
217 } | 217 } |
218 | 218 |
219 void SetServerReachable(); | 219 void SetServerReachable(); |
220 | 220 |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 scoped_ptr<sync_pb::ClientCommand> client_command_; | 337 scoped_ptr<sync_pb::ClientCommand> client_command_; |
338 | 338 |
339 // The next value to use for the position_in_parent property. | 339 // The next value to use for the position_in_parent property. |
340 int64 next_position_in_parent_; | 340 int64 next_position_in_parent_; |
341 | 341 |
342 // The default is to use the newer sync_pb::BookmarkSpecifics-style protocol. | 342 // The default is to use the newer sync_pb::BookmarkSpecifics-style protocol. |
343 // If this option is set to true, then the MockConnectionManager will | 343 // If this option is set to true, then the MockConnectionManager will |
344 // use the older sync_pb::SyncEntity_BookmarkData-style protocol. | 344 // use the older sync_pb::SyncEntity_BookmarkData-style protocol. |
345 bool use_legacy_bookmarks_protocol_; | 345 bool use_legacy_bookmarks_protocol_; |
346 | 346 |
347 syncable::ModelEnumSet expected_filter_; | 347 syncable::ModelTypeSet expected_filter_; |
348 | 348 |
349 syncable::ModelTypePayloadMap expected_payloads_; | 349 syncable::ModelTypePayloadMap expected_payloads_; |
350 | 350 |
351 int num_get_updates_requests_; | 351 int num_get_updates_requests_; |
352 | 352 |
353 std::string next_token_; | 353 std::string next_token_; |
354 | 354 |
355 sync_pb::ClientToServerMessage last_request_; | 355 sync_pb::ClientToServerMessage last_request_; |
356 | 356 |
357 DISALLOW_COPY_AND_ASSIGN(MockConnectionManager); | 357 DISALLOW_COPY_AND_ASSIGN(MockConnectionManager); |
358 }; | 358 }; |
359 | 359 |
360 #endif // CHROME_BROWSER_SYNC_TEST_ENGINE_MOCK_CONNECTION_MANAGER_H_ | 360 #endif // CHROME_BROWSER_SYNC_TEST_ENGINE_MOCK_CONNECTION_MANAGER_H_ |
OLD | NEW |