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

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

Issue 891123003: Revert of Sync commit errors should temporarily re-enable trigger pre-commit getupdates (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « sync/sessions/nudge_tracker_unittest.cc ('k') | sync/sessions/test_util.cc » ('j') | 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 // 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 17 matching lines...) Expand all
28 ModelTypeSet requested_types, 28 ModelTypeSet requested_types,
29 sync_pb::GetUpdatesCallerInfo::GetUpdatesSource source, 29 sync_pb::GetUpdatesCallerInfo::GetUpdatesSource source,
30 sessions::SyncSession* session); 30 sessions::SyncSession* session);
31 void SimulateConfigureConnectionFailure( 31 void SimulateConfigureConnectionFailure(
32 ModelTypeSet requested_types, 32 ModelTypeSet requested_types,
33 sync_pb::GetUpdatesCallerInfo::GetUpdatesSource source, 33 sync_pb::GetUpdatesCallerInfo::GetUpdatesSource source,
34 sessions::SyncSession* session); 34 sessions::SyncSession* session);
35 35
36 // Normal mode sync cycle successes and failures. 36 // Normal mode sync cycle successes and failures.
37 void SimulateNormalSuccess(ModelTypeSet requested_types, 37 void SimulateNormalSuccess(ModelTypeSet requested_types,
38 sessions::NudgeTracker* nudge_tracker, 38 const sessions::NudgeTracker& nudge_tracker,
39 sessions::SyncSession* session); 39 sessions::SyncSession* session);
40 void SimulateDownloadUpdatesFailed(ModelTypeSet requested_types, 40 void SimulateDownloadUpdatesFailed(ModelTypeSet requested_types,
41 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 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 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 successes and failures.
51 void SimulatePollSuccess(ModelTypeSet requested_types, 51 void SimulatePollSuccess(ModelTypeSet requested_types,
52 sessions::SyncSession* session); 52 sessions::SyncSession* session);
53 void SimulatePollFailed(ModelTypeSet requested_types, 53 void SimulatePollFailed(ModelTypeSet requested_types,
54 sessions::SyncSession* session); 54 sessions::SyncSession* session);
55 55
56 void SimulateGuRetryDelayCommandImpl(sessions::SyncSession* session, 56 void SimulateGuRetryDelayCommandImpl(sessions::SyncSession* session,
57 base::TimeDelta delay); 57 base::TimeDelta delay);
58 58
59 void SimulateThrottledImpl(sessions::SyncSession* session, 59 void SimulateThrottledImpl(sessions::SyncSession* session,
60 const base::TimeDelta& delta); 60 const base::TimeDelta& delta);
61 61
62 void SimulateTypesThrottledImpl( 62 void SimulateTypesThrottledImpl(
63 sessions::SyncSession* session, 63 sessions::SyncSession* session,
64 ModelTypeSet types, 64 ModelTypeSet types,
65 const base::TimeDelta& delta); 65 const base::TimeDelta& delta);
66 66
67 // Works with poll cycles. 67 // Works with poll cycles.
68 void SimulatePollIntervalUpdateImpl( 68 void SimulatePollIntervalUpdateImpl(
69 ModelTypeSet requested_types, 69 ModelTypeSet requested_types,
70 sessions::SyncSession* session, 70 sessions::SyncSession* session,
71 const base::TimeDelta& new_poll); 71 const base::TimeDelta& new_poll);
72 72
73 // Works with normal cycles. 73 // Works with normal cycles.
74 void SimulateSessionsCommitDelayUpdateImpl( 74 void SimulateSessionsCommitDelayUpdateImpl(
75 ModelTypeSet requested_types, 75 ModelTypeSet requested_types,
76 sessions::NudgeTracker* nudge_tracker, 76 const sessions::NudgeTracker& nudge_tracker,
77 sessions::SyncSession* session, 77 sessions::SyncSession* session,
78 const base::TimeDelta& new_delay); 78 const base::TimeDelta& new_delay);
79 79
80 ACTION_P(SimulateThrottled, throttle) { 80 ACTION_P(SimulateThrottled, throttle) {
81 SimulateThrottledImpl(arg0, throttle); 81 SimulateThrottledImpl(arg0, throttle);
82 } 82 }
83 83
84 ACTION_P2(SimulateTypesThrottled, types, throttle) { 84 ACTION_P2(SimulateTypesThrottled, types, throttle) {
85 SimulateTypesThrottledImpl(arg0, types, throttle); 85 SimulateTypesThrottledImpl(arg0, types, throttle);
86 } 86 }
87 87
88 ACTION_P(SimulatePollIntervalUpdate, poll) { 88 ACTION_P(SimulatePollIntervalUpdate, poll) {
89 SimulatePollIntervalUpdateImpl(arg0, arg1, poll); 89 SimulatePollIntervalUpdateImpl(arg0, arg1, poll);
90 } 90 }
91 91
92 ACTION_P(SimulateSessionsCommitDelayUpdate, poll) { 92 ACTION_P(SimulateSessionsCommitDelayUpdate, poll) {
93 SimulateSessionsCommitDelayUpdateImpl(arg0, arg1, arg2, poll); 93 SimulateSessionsCommitDelayUpdateImpl(arg0, arg1, arg2, poll);
94 } 94 }
95 95
96 ACTION_P(SimulateGuRetryDelayCommand, delay) { 96 ACTION_P(SimulateGuRetryDelayCommand, delay) {
97 SimulateGuRetryDelayCommandImpl(arg0, delay); 97 SimulateGuRetryDelayCommandImpl(arg0, delay);
98 } 98 }
99 99
100 } // namespace test_util 100 } // namespace test_util
101 } // namespace sessions 101 } // namespace sessions
102 } // namespace syncer 102 } // namespace syncer
103 103
104 #endif // SYNC_SESSIONS_TEST_UTIL_H_ 104 #endif // SYNC_SESSIONS_TEST_UTIL_H_
OLDNEW
« no previous file with comments | « sync/sessions/nudge_tracker_unittest.cc ('k') | sync/sessions/test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698