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

Unified Diff: sync/sessions/test_util.cc

Issue 10825439: sync: remove buggy freshness condition in SyncSchedulerImpl add defensive DCHECKs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: FIX Created 8 years, 3 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/engine/sync_scheduler_whitebox_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/sessions/test_util.cc
diff --git a/sync/sessions/test_util.cc b/sync/sessions/test_util.cc
index ef734b7a538350b67b762ecf1329c70bede56eab..4214c3d44bd16afffce64550ddede6a4e4ff3e14 100644
--- a/sync/sessions/test_util.cc
+++ b/sync/sessions/test_util.cc
@@ -48,11 +48,19 @@ void SimulateSuccess(sessions::SyncSession* session,
}
ASSERT_EQ(0U, session->status_controller().num_server_changes_remaining());
session->SetFinished();
- if (end == SYNCER_END) {
- session->mutable_status_controller()->set_last_get_key_result(SYNCER_OK);
- session->mutable_status_controller()->set_last_download_updates_result(
- SYNCER_OK);
- session->mutable_status_controller()->set_commit_result(SYNCER_OK);
+ switch(end) {
+ case SYNCER_END:
+ session->mutable_status_controller()->set_commit_result(SYNCER_OK);
+ // Fall through.
+ case APPLY_UPDATES:
+ DCHECK_EQ(end == APPLY_UPDATES, session->source().updates_source ==
+ sync_pb::GetUpdatesCallerInfo::RECONFIGURATION);
+ session->mutable_status_controller()->set_last_get_key_result(SYNCER_OK);
+ session->mutable_status_controller()->set_last_download_updates_result(
+ SYNCER_OK);
+ break;
+ default:
+ ADD_FAILURE() << "Not a valid END state.";
}
}
« no previous file with comments | « sync/engine/sync_scheduler_whitebox_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698