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

Side by Side Diff: sync/sessions/test_util.cc

Issue 10537032: [Sync] Fix sync scheduler/session logic determining successful commands. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Self review Created 8 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« sync/sessions/sync_session.h ('K') | « sync/sessions/sync_session.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "sync/sessions/test_util.h" 5 #include "sync/sessions/test_util.h"
6 6
7 namespace browser_sync { 7 namespace browser_sync {
8 namespace sessions { 8 namespace sessions {
9 namespace test_util { 9 namespace test_util {
10 10
(...skipping 20 matching lines...) Expand all
31 session->mutable_status_controller()->set_last_download_updates_result( 31 session->mutable_status_controller()->set_last_download_updates_result(
32 NETWORK_CONNECTION_UNAVAILABLE); 32 NETWORK_CONNECTION_UNAVAILABLE);
33 } 33 }
34 34
35 void SimulateSuccess(sessions::SyncSession* session, 35 void SimulateSuccess(sessions::SyncSession* session,
36 SyncerStep begin, SyncerStep end) { 36 SyncerStep begin, SyncerStep end) {
37 if (session->HasMoreToSync()) { 37 if (session->HasMoreToSync()) {
38 ADD_FAILURE() << "Shouldn't have more to sync"; 38 ADD_FAILURE() << "Shouldn't have more to sync";
39 } 39 }
40 ASSERT_EQ(0U, session->status_controller().num_server_changes_remaining()); 40 ASSERT_EQ(0U, session->status_controller().num_server_changes_remaining());
41 session->SetFinished();
42 if (end == SYNCER_END) {
43 session->mutable_status_controller()->set_last_download_updates_result(
44 SYNCER_OK);
45 session->mutable_status_controller()->set_last_post_commit_result(
46 SYNCER_OK);
47 session->mutable_status_controller()->
48 set_last_process_commit_response_result(SYNCER_OK);
49 }
41 } 50 }
42 51
43 void SimulateThrottledImpl(sessions::SyncSession* session, 52 void SimulateThrottledImpl(sessions::SyncSession* session,
44 const base::TimeDelta& delta) { 53 const base::TimeDelta& delta) {
45 session->delegate()->OnSilencedUntil(base::TimeTicks::Now() + delta); 54 session->delegate()->OnSilencedUntil(base::TimeTicks::Now() + delta);
46 } 55 }
47 56
48 void SimulatePollIntervalUpdateImpl(sessions::SyncSession* session, 57 void SimulatePollIntervalUpdateImpl(sessions::SyncSession* session,
49 const base::TimeDelta& new_poll) { 58 const base::TimeDelta& new_poll) {
50 session->delegate()->OnReceivedLongPollIntervalUpdate(new_poll); 59 session->delegate()->OnReceivedLongPollIntervalUpdate(new_poll);
51 } 60 }
52 61
53 void SimulateSessionsCommitDelayUpdateImpl(sessions::SyncSession* session, 62 void SimulateSessionsCommitDelayUpdateImpl(sessions::SyncSession* session,
54 const base::TimeDelta& new_delay) { 63 const base::TimeDelta& new_delay) {
55 session->delegate()->OnReceivedSessionsCommitDelay(new_delay); 64 session->delegate()->OnReceivedSessionsCommitDelay(new_delay);
56 } 65 }
57 66
58 } // namespace test_util 67 } // namespace test_util
59 } // namespace sessions 68 } // namespace sessions
60 } // namespace browser_sync 69 } // namespace browser_sync
OLDNEW
« sync/sessions/sync_session.h ('K') | « sync/sessions/sync_session.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698