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

Side by Side Diff: components/sync/engine_impl/cycle/test_util.h

Issue 2475043002: [Sync] Sync client should to exponential backoff when receive partial failure (Closed)
Patch Set: rebase Created 4 years, 1 month 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
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 #ifndef COMPONENTS_SYNC_ENGINE_IMPL_CYCLE_TEST_UTIL_H_ 5 #ifndef COMPONENTS_SYNC_ENGINE_IMPL_CYCLE_TEST_UTIL_H_
6 #define COMPONENTS_SYNC_ENGINE_IMPL_CYCLE_TEST_UTIL_H_ 6 #define COMPONENTS_SYNC_ENGINE_IMPL_CYCLE_TEST_UTIL_H_
7 7
8 #include "components/sync/engine_impl/cycle/sync_cycle.h" 8 #include "components/sync/engine_impl/cycle/sync_cycle.h"
9 #include "components/sync/engine_impl/syncer.h" 9 #include "components/sync/engine_impl/syncer.h"
10 #include "testing/gmock/include/gmock/gmock.h" 10 #include "testing/gmock/include/gmock/gmock.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 void SimulatePollFailed(ModelTypeSet requested_types, SyncCycle* cycle); 52 void SimulatePollFailed(ModelTypeSet requested_types, SyncCycle* cycle);
53 53
54 void SimulateGuRetryDelayCommandImpl(SyncCycle* cycle, base::TimeDelta delay); 54 void SimulateGuRetryDelayCommandImpl(SyncCycle* cycle, base::TimeDelta delay);
55 55
56 void SimulateThrottledImpl(SyncCycle* cycle, const base::TimeDelta& delta); 56 void SimulateThrottledImpl(SyncCycle* cycle, const base::TimeDelta& delta);
57 57
58 void SimulateTypesThrottledImpl(SyncCycle* cycle, 58 void SimulateTypesThrottledImpl(SyncCycle* cycle,
59 ModelTypeSet types, 59 ModelTypeSet types,
60 const base::TimeDelta& delta); 60 const base::TimeDelta& delta);
61 61
62 void SimulatePartialFailureImpl(SyncCycle* cycle, ModelTypeSet types);
63
62 // Works with poll cycles. 64 // Works with poll cycles.
63 void SimulatePollIntervalUpdateImpl(ModelTypeSet requested_types, 65 void SimulatePollIntervalUpdateImpl(ModelTypeSet requested_types,
64 SyncCycle* cycle, 66 SyncCycle* cycle,
65 const base::TimeDelta& new_poll); 67 const base::TimeDelta& new_poll);
66 68
67 // Works with normal cycles. 69 // Works with normal cycles.
68 void SimulateSessionsCommitDelayUpdateImpl(ModelTypeSet requested_types, 70 void SimulateSessionsCommitDelayUpdateImpl(ModelTypeSet requested_types,
69 NudgeTracker* nudge_tracker, 71 NudgeTracker* nudge_tracker,
70 SyncCycle* cycle, 72 SyncCycle* cycle,
71 const base::TimeDelta& new_delay); 73 const base::TimeDelta& new_delay);
72 74
73 ACTION_P(SimulateThrottled, throttle) { 75 ACTION_P(SimulateThrottled, throttle) {
74 SimulateThrottledImpl(arg0, throttle); 76 SimulateThrottledImpl(arg0, throttle);
75 } 77 }
76 78
77 ACTION_P2(SimulateTypesThrottled, types, throttle) { 79 ACTION_P2(SimulateTypesThrottled, types, throttle) {
78 SimulateTypesThrottledImpl(arg0, types, throttle); 80 SimulateTypesThrottledImpl(arg0, types, throttle);
79 } 81 }
80 82
83 ACTION_P(SimulatePartialFailure, types) {
84 SimulatePartialFailureImpl(arg0, types);
85 }
86
81 ACTION_P(SimulatePollIntervalUpdate, poll) { 87 ACTION_P(SimulatePollIntervalUpdate, poll) {
82 SimulatePollIntervalUpdateImpl(arg0, arg1, poll); 88 SimulatePollIntervalUpdateImpl(arg0, arg1, poll);
83 } 89 }
84 90
85 ACTION_P(SimulateSessionsCommitDelayUpdate, poll) { 91 ACTION_P(SimulateSessionsCommitDelayUpdate, poll) {
86 SimulateSessionsCommitDelayUpdateImpl(arg0, arg1, arg2, poll); 92 SimulateSessionsCommitDelayUpdateImpl(arg0, arg1, arg2, poll);
87 } 93 }
88 94
89 ACTION_P(SimulateGuRetryDelayCommand, delay) { 95 ACTION_P(SimulateGuRetryDelayCommand, delay) {
90 SimulateGuRetryDelayCommandImpl(arg0, delay); 96 SimulateGuRetryDelayCommandImpl(arg0, delay);
91 } 97 }
92 98
93 } // namespace test_util 99 } // namespace test_util
94 } // namespace syncer 100 } // namespace syncer
95 101
96 #endif // COMPONENTS_SYNC_ENGINE_IMPL_CYCLE_TEST_UTIL_H_ 102 #endif // COMPONENTS_SYNC_ENGINE_IMPL_CYCLE_TEST_UTIL_H_
OLDNEW
« no previous file with comments | « components/sync/engine_impl/cycle/sync_cycle.h ('k') | components/sync/engine_impl/cycle/test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698