| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/test/sync/engine/mock_server_connection.h" | 7 #include "chrome/test/sync/engine/mock_server_connection.h" |
| 8 | 8 |
| 9 #include "chrome/browser/sync/engine/syncer_proto_util.h" | 9 #include "chrome/browser/sync/engine/syncer_proto_util.h" |
| 10 #include "chrome/browser/sync/util/character_set_converters.h" | 10 #include "chrome/browser/sync/util/character_set_converters.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 next_new_id_(10000), | 36 next_new_id_(10000), |
| 37 store_birthday_("Store BDay!"), | 37 store_birthday_("Store BDay!"), |
| 38 store_birthday_sent_(false), | 38 store_birthday_sent_(false), |
| 39 client_stuck_(false), | 39 client_stuck_(false), |
| 40 commit_time_rename_prepended_string_(""), | 40 commit_time_rename_prepended_string_(""), |
| 41 fail_next_postbuffer_(false), | 41 fail_next_postbuffer_(false), |
| 42 directory_manager_(dirmgr), | 42 directory_manager_(dirmgr), |
| 43 directory_name_(name), | 43 directory_name_(name), |
| 44 mid_commit_callback_function_(NULL), | 44 mid_commit_callback_function_(NULL), |
| 45 mid_commit_observer_(NULL), | 45 mid_commit_observer_(NULL), |
| 46 client_command_(NULL), | |
| 47 throttling_(false), | 46 throttling_(false), |
| 48 fail_non_periodic_get_updates_(false), | 47 fail_non_periodic_get_updates_(false), |
| 48 client_command_(NULL), |
| 49 next_position_in_parent_(2) { | 49 next_position_in_parent_(2) { |
| 50 server_reachable_ = true; | 50 server_reachable_ = true; |
| 51 }; | 51 }; |
| 52 | 52 |
| 53 MockConnectionManager::~MockConnectionManager() { | 53 MockConnectionManager::~MockConnectionManager() { |
| 54 for (size_t i = 0; i < commit_messages_.size(); i++) | 54 for (size_t i = 0; i < commit_messages_.size(); i++) |
| 55 delete commit_messages_[i]; | 55 delete commit_messages_[i]; |
| 56 } | 56 } |
| 57 | 57 |
| 58 void MockConnectionManager::SetCommitTimeRename(string prepend) { | 58 void MockConnectionManager::SetCommitTimeRename(string prepend) { |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 DCHECK(!commit_messages_.empty()); | 398 DCHECK(!commit_messages_.empty()); |
| 399 return *commit_messages_.back(); | 399 return *commit_messages_.back(); |
| 400 } | 400 } |
| 401 | 401 |
| 402 void MockConnectionManager::ThrottleNextRequest( | 402 void MockConnectionManager::ThrottleNextRequest( |
| 403 ThrottleRequestVisitor* visitor) { | 403 ThrottleRequestVisitor* visitor) { |
| 404 AutoLock lock(throttle_lock_); | 404 AutoLock lock(throttle_lock_); |
| 405 throttling_ = true; | 405 throttling_ = true; |
| 406 if (visitor) | 406 if (visitor) |
| 407 visitor->VisitAtomically(); | 407 visitor->VisitAtomically(); |
| 408 } | 408 } |
| 409 |
| OLD | NEW |