| OLD | NEW |
| 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 Loading... |
| 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 ASSERT_EQ(0U, session->status_controller().unsynced_handles().size()); | |
| 42 } | 41 } |
| 43 | 42 |
| 44 void SimulateThrottledImpl(sessions::SyncSession* session, | 43 void SimulateThrottledImpl(sessions::SyncSession* session, |
| 45 const base::TimeDelta& delta) { | 44 const base::TimeDelta& delta) { |
| 46 session->delegate()->OnSilencedUntil(base::TimeTicks::Now() + delta); | 45 session->delegate()->OnSilencedUntil(base::TimeTicks::Now() + delta); |
| 47 } | 46 } |
| 48 | 47 |
| 49 void SimulatePollIntervalUpdateImpl(sessions::SyncSession* session, | 48 void SimulatePollIntervalUpdateImpl(sessions::SyncSession* session, |
| 50 const base::TimeDelta& new_poll) { | 49 const base::TimeDelta& new_poll) { |
| 51 session->delegate()->OnReceivedLongPollIntervalUpdate(new_poll); | 50 session->delegate()->OnReceivedLongPollIntervalUpdate(new_poll); |
| 52 } | 51 } |
| 53 | 52 |
| 54 void SimulateSessionsCommitDelayUpdateImpl(sessions::SyncSession* session, | 53 void SimulateSessionsCommitDelayUpdateImpl(sessions::SyncSession* session, |
| 55 const base::TimeDelta& new_delay) { | 54 const base::TimeDelta& new_delay) { |
| 56 session->delegate()->OnReceivedSessionsCommitDelay(new_delay); | 55 session->delegate()->OnReceivedSessionsCommitDelay(new_delay); |
| 57 } | 56 } |
| 58 | 57 |
| 59 } // namespace test_util | 58 } // namespace test_util |
| 60 } // namespace sessions | 59 } // namespace sessions |
| 61 } // namespace browser_sync | 60 } // namespace browser_sync |
| OLD | NEW |