| 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 successes and failures. | 50 // Poll/Retry successes and failures. |
| 51 void SimulatePollSuccess(ModelTypeSet requested_types, | 51 void SimulatePollRetrySuccess(ModelTypeSet requested_types, |
| 52 sessions::SyncSession* session); | 52 sessions::SyncSession* session); |
| 53 void SimulatePollFailed(ModelTypeSet requested_types, | 53 void SimulatePollRetryFailed(ModelTypeSet requested_types, |
| 54 sessions::SyncSession* session); | 54 sessions::SyncSession* session); |
| 55 |
| 56 void SimulateGuRetryDelayCommandImpl(sessions::SyncSession* session, |
| 57 base::TimeDelta delay); |
| 55 | 58 |
| 56 void SimulateThrottledImpl(sessions::SyncSession* session, | 59 void SimulateThrottledImpl(sessions::SyncSession* session, |
| 57 const base::TimeDelta& delta); | 60 const base::TimeDelta& delta); |
| 58 | 61 |
| 59 void SimulateTypesThrottledImpl( | 62 void SimulateTypesThrottledImpl( |
| 60 sessions::SyncSession* session, | 63 sessions::SyncSession* session, |
| 61 ModelTypeSet types, | 64 ModelTypeSet types, |
| 62 const base::TimeDelta& delta); | 65 const base::TimeDelta& delta); |
| 63 | 66 |
| 64 // Works with poll cycles. | 67 // Works with poll cycles. |
| (...skipping 18 matching lines...) Expand all Loading... |
| 83 } | 86 } |
| 84 | 87 |
| 85 ACTION_P(SimulatePollIntervalUpdate, poll) { | 88 ACTION_P(SimulatePollIntervalUpdate, poll) { |
| 86 SimulatePollIntervalUpdateImpl(arg0, arg1, poll); | 89 SimulatePollIntervalUpdateImpl(arg0, arg1, poll); |
| 87 } | 90 } |
| 88 | 91 |
| 89 ACTION_P(SimulateSessionsCommitDelayUpdate, poll) { | 92 ACTION_P(SimulateSessionsCommitDelayUpdate, poll) { |
| 90 SimulateSessionsCommitDelayUpdateImpl(arg0, arg1, arg2, poll); | 93 SimulateSessionsCommitDelayUpdateImpl(arg0, arg1, arg2, poll); |
| 91 } | 94 } |
| 92 | 95 |
| 96 ACTION_P(SimulateGuRetryDelayCommand, delay) { |
| 97 SimulateGuRetryDelayCommandImpl(arg0, delay); |
| 98 } |
| 99 |
| 93 } // namespace test_util | 100 } // namespace test_util |
| 94 } // namespace sessions | 101 } // namespace sessions |
| 95 } // namespace syncer | 102 } // namespace syncer |
| 96 | 103 |
| 97 #endif // SYNC_SESSIONS_TEST_UTIL_H_ | 104 #endif // SYNC_SESSIONS_TEST_UTIL_H_ |
| OLD | NEW |