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..127e85887a1c4b29ed1c14a3f38054b72e3859af 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; |
} |