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

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

Issue 10103017: Abort sync cycles when download step fails (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove notifications re-enable code 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
« no previous file with comments | « 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..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,
« no previous file with comments | « 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