| 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 regression tests. | 5 // Mock ServerConnectionManager class for use in client regression tests. |
| 6 | 6 |
| 7 #include "sync/test/engine/mock_connection_manager.h" | 7 #include "sync/test/engine/mock_connection_manager.h" |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 using sync_pb::SyncEnums; | 34 using sync_pb::SyncEnums; |
| 35 using sync_pb::SyncEntity; | 35 using sync_pb::SyncEntity; |
| 36 using syncable::FIRST_REAL_MODEL_TYPE; | 36 using syncable::FIRST_REAL_MODEL_TYPE; |
| 37 using syncable::MODEL_TYPE_COUNT; | 37 using syncable::MODEL_TYPE_COUNT; |
| 38 using syncable::ModelType; | 38 using syncable::ModelType; |
| 39 using syncable::WriteTransaction; | 39 using syncable::WriteTransaction; |
| 40 | 40 |
| 41 static char kValidAuthToken[] = "AuthToken"; | 41 static char kValidAuthToken[] = "AuthToken"; |
| 42 | 42 |
| 43 MockConnectionManager::MockConnectionManager(syncable::Directory* directory) | 43 MockConnectionManager::MockConnectionManager(syncable::Directory* directory) |
| 44 : ServerConnectionManager("unused", 0, false, "version"), | 44 : ServerConnectionManager("unused", 0, false), |
| 45 server_reachable_(true), | 45 server_reachable_(true), |
| 46 conflict_all_commits_(false), | 46 conflict_all_commits_(false), |
| 47 conflict_n_commits_(0), | 47 conflict_n_commits_(0), |
| 48 next_new_id_(10000), | 48 next_new_id_(10000), |
| 49 store_birthday_("Store BDay!"), | 49 store_birthday_("Store BDay!"), |
| 50 store_birthday_sent_(false), | 50 store_birthday_sent_(false), |
| 51 client_stuck_(false), | 51 client_stuck_(false), |
| 52 commit_time_rename_prepended_string_(""), | 52 commit_time_rename_prepended_string_(""), |
| 53 countdown_to_postbuffer_fail_(0), | 53 countdown_to_postbuffer_fail_(0), |
| 54 directory_(directory), | 54 directory_(directory), |
| (...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 586 server_reachable_ = false; | 586 server_reachable_ = false; |
| 587 } | 587 } |
| 588 | 588 |
| 589 void MockConnectionManager::UpdateConnectionStatus() { | 589 void MockConnectionManager::UpdateConnectionStatus() { |
| 590 if (!server_reachable_) { | 590 if (!server_reachable_) { |
| 591 server_status_ = HttpResponse::CONNECTION_UNAVAILABLE; | 591 server_status_ = HttpResponse::CONNECTION_UNAVAILABLE; |
| 592 } else { | 592 } else { |
| 593 server_status_ = HttpResponse::SERVER_CONNECTION_OK; | 593 server_status_ = HttpResponse::SERVER_CONNECTION_OK; |
| 594 } | 594 } |
| 595 } | 595 } |
| OLD | NEW |