Index: sync/test/engine/mock_connection_manager.cc |
diff --git a/sync/test/engine/mock_connection_manager.cc b/sync/test/engine/mock_connection_manager.cc |
index ab95bce6f2afe92e3fb39c5b03603b7034417f68..166b27ac4142976fcb66e05085bdbc2eebe6aa24 100644 |
--- a/sync/test/engine/mock_connection_manager.cc |
+++ b/sync/test/engine/mock_connection_manager.cc |
@@ -48,7 +48,7 @@ MockConnectionManager::MockConnectionManager(syncable::Directory* directory) |
store_birthday_sent_(false), |
client_stuck_(false), |
commit_time_rename_prepended_string_(""), |
- fail_next_postbuffer_(false), |
+ countdown_to_postbuffer_fail_(0), |
directory_(directory), |
mid_commit_observer_(NULL), |
throttling_(false), |
@@ -111,8 +111,9 @@ bool MockConnectionManager::PostBufferToPath(PostBufferParams* params, |
InvalidateAndClearAuthToken(); |
} |
- if (fail_next_postbuffer_) { |
- fail_next_postbuffer_ = false; |
+ if (--countdown_to_postbuffer_fail_ == 0) { |
+ // Fail as countdown hits zero. |
+ params->response.server_status = HttpResponse::SYNC_SERVER_ERROR; |
return false; |
} |
@@ -564,30 +565,6 @@ const CommitResponse& MockConnectionManager::last_commit_response() const { |
return *commit_responses_->back(); |
} |
-void MockConnectionManager::ThrottleNextRequest( |
- ResponseCodeOverrideRequestor* visitor) { |
- base::AutoLock lock(response_code_override_lock_); |
- throttling_ = true; |
- if (visitor) |
- visitor->OnOverrideComplete(); |
-} |
- |
-void MockConnectionManager::FailWithAuthInvalid( |
- ResponseCodeOverrideRequestor* visitor) { |
- base::AutoLock lock(response_code_override_lock_); |
- fail_with_auth_invalid_ = true; |
- if (visitor) |
- visitor->OnOverrideComplete(); |
-} |
- |
-void MockConnectionManager::StopFailingWithAuthInvalid( |
- ResponseCodeOverrideRequestor* visitor) { |
- base::AutoLock lock(response_code_override_lock_); |
- fail_with_auth_invalid_ = false; |
- if (visitor) |
- visitor->OnOverrideComplete(); |
-} |
- |
bool MockConnectionManager::IsModelTypePresentInSpecifics( |
const google::protobuf::RepeatedPtrField< |
sync_pb::DataTypeProgressMarker>& filter, |