Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(547)

Unified Diff: sync/test/engine/mock_connection_manager.cc

Issue 10006046: Abort sync cycles when download step fails (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« sync/engine/syncer.cc ('K') | « sync/test/engine/mock_connection_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« sync/engine/syncer.cc ('K') | « sync/test/engine/mock_connection_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698