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

Unified Diff: sync/sessions/test_util.cc

Issue 10917234: sync: make scheduling logic and job ownership more obvious. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: eof Created 8 years, 2 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/sessions/sync_session_unittest.cc ('k') | sync/sync.gyp » ('j') | 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 4214c3d44bd16afffce64550ddede6a4e4ff3e14..cef5121b90dd6f6a159d9a48b4b4bbd3c7af89cd 100644
--- a/sync/sessions/test_util.cc
+++ b/sync/sessions/test_util.cc
@@ -31,6 +31,9 @@ void SimulateDownloadUpdatesFailed(sessions::SyncSession* session,
void SimulateCommitFailed(sessions::SyncSession* session,
SyncerStep begin, SyncerStep 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(
SERVER_RETURN_TRANSIENT_ERROR);
}
@@ -47,7 +50,6 @@ void SimulateSuccess(sessions::SyncSession* session,
ADD_FAILURE() << "Shouldn't have more to sync";
}
ASSERT_EQ(0U, session->status_controller().num_server_changes_remaining());
- session->SetFinished();
switch(end) {
case SYNCER_END:
session->mutable_status_controller()->set_commit_result(SYNCER_OK);
@@ -66,16 +68,20 @@ void SimulateSuccess(sessions::SyncSession* session,
void SimulateThrottledImpl(sessions::SyncSession* session,
const base::TimeDelta& delta) {
+ session->mutable_status_controller()->set_last_download_updates_result(
+ SERVER_RETURN_THROTTLED);
session->delegate()->OnSilencedUntil(base::TimeTicks::Now() + delta);
}
void SimulatePollIntervalUpdateImpl(sessions::SyncSession* session,
const base::TimeDelta& new_poll) {
+ SimulateSuccess(session, SYNCER_BEGIN, SYNCER_END);
session->delegate()->OnReceivedLongPollIntervalUpdate(new_poll);
}
void SimulateSessionsCommitDelayUpdateImpl(sessions::SyncSession* session,
const base::TimeDelta& new_delay) {
+ SimulateSuccess(session, SYNCER_BEGIN, SYNCER_END);
session->delegate()->OnReceivedSessionsCommitDelay(new_delay);
}
« no previous file with comments | « sync/sessions/sync_session_unittest.cc ('k') | sync/sync.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698