| 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 // Utils to simulate various outcomes of a sync session. | 5 // Utils to simulate various outcomes of a sync session. |
| 6 #ifndef SYNC_SESSIONS_TEST_UTIL_H_ | 6 #ifndef SYNC_SESSIONS_TEST_UTIL_H_ |
| 7 #define SYNC_SESSIONS_TEST_UTIL_H_ | 7 #define SYNC_SESSIONS_TEST_UTIL_H_ |
| 8 | 8 |
| 9 #include "sync/engine/syncer.h" | 9 #include "sync/engine/syncer.h" |
| 10 #include "sync/sessions/sync_session.h" | 10 #include "sync/sessions/sync_session.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 void SimulateDownloadUpdatesFailed(ModelTypeSet requested_types, | 40 void SimulateDownloadUpdatesFailed(ModelTypeSet requested_types, |
| 41 const sessions::NudgeTracker& nudge_tracker, | 41 const sessions::NudgeTracker& nudge_tracker, |
| 42 sessions::SyncSession* session); | 42 sessions::SyncSession* session); |
| 43 void SimulateCommitFailed(ModelTypeSet requested_types, | 43 void SimulateCommitFailed(ModelTypeSet requested_types, |
| 44 const sessions::NudgeTracker& nudge_tracker, | 44 const sessions::NudgeTracker& nudge_tracker, |
| 45 sessions::SyncSession* session); | 45 sessions::SyncSession* session); |
| 46 void SimulateConnectionFailure(ModelTypeSet requested_types, | 46 void SimulateConnectionFailure(ModelTypeSet requested_types, |
| 47 const sessions::NudgeTracker& nudge_tracker, | 47 const sessions::NudgeTracker& nudge_tracker, |
| 48 sessions::SyncSession* session); | 48 sessions::SyncSession* session); |
| 49 | 49 |
| 50 // Poll/Retry successes and failures. | 50 // Poll successes and failures. |
| 51 void SimulatePollRetrySuccess(ModelTypeSet requested_types, | 51 void SimulatePollSuccess(ModelTypeSet requested_types, |
| 52 sessions::SyncSession* session); | 52 sessions::SyncSession* session); |
| 53 void SimulatePollRetryFailed(ModelTypeSet requested_types, | 53 void SimulatePollFailed(ModelTypeSet requested_types, |
| 54 sessions::SyncSession* session); | 54 sessions::SyncSession* session); |
| 55 | |
| 56 void SimulateGuRetryDelayCommandImpl(sessions::SyncSession* session, | |
| 57 base::TimeDelta delay); | |
| 58 | 55 |
| 59 void SimulateThrottledImpl(sessions::SyncSession* session, | 56 void SimulateThrottledImpl(sessions::SyncSession* session, |
| 60 const base::TimeDelta& delta); | 57 const base::TimeDelta& delta); |
| 61 | 58 |
| 62 void SimulateTypesThrottledImpl( | 59 void SimulateTypesThrottledImpl( |
| 63 sessions::SyncSession* session, | 60 sessions::SyncSession* session, |
| 64 ModelTypeSet types, | 61 ModelTypeSet types, |
| 65 const base::TimeDelta& delta); | 62 const base::TimeDelta& delta); |
| 66 | 63 |
| 67 // Works with poll cycles. | 64 // Works with poll cycles. |
| (...skipping 18 matching lines...) Expand all Loading... |
| 86 } | 83 } |
| 87 | 84 |
| 88 ACTION_P(SimulatePollIntervalUpdate, poll) { | 85 ACTION_P(SimulatePollIntervalUpdate, poll) { |
| 89 SimulatePollIntervalUpdateImpl(arg0, arg1, poll); | 86 SimulatePollIntervalUpdateImpl(arg0, arg1, poll); |
| 90 } | 87 } |
| 91 | 88 |
| 92 ACTION_P(SimulateSessionsCommitDelayUpdate, poll) { | 89 ACTION_P(SimulateSessionsCommitDelayUpdate, poll) { |
| 93 SimulateSessionsCommitDelayUpdateImpl(arg0, arg1, arg2, poll); | 90 SimulateSessionsCommitDelayUpdateImpl(arg0, arg1, arg2, poll); |
| 94 } | 91 } |
| 95 | 92 |
| 96 ACTION_P(SimulateGuRetryDelayCommand, delay) { | |
| 97 SimulateGuRetryDelayCommandImpl(arg0, delay); | |
| 98 } | |
| 99 | |
| 100 } // namespace test_util | 93 } // namespace test_util |
| 101 } // namespace sessions | 94 } // namespace sessions |
| 102 } // namespace syncer | 95 } // namespace syncer |
| 103 | 96 |
| 104 #endif // SYNC_SESSIONS_TEST_UTIL_H_ | 97 #endif // SYNC_SESSIONS_TEST_UTIL_H_ |
| OLD | NEW |