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

Side by Side Diff: components/sync/sessions_impl/test_util.h

Issue 2258873003: [Sync] Move sessions/ to engine/cycle/ and rename things to match. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. Created 4 years, 4 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4 //
5 // Utils to simulate various outcomes of a sync session.
6 #ifndef COMPONENTS_SYNC_SESSIONS_IMPL_TEST_UTIL_H_
7 #define COMPONENTS_SYNC_SESSIONS_IMPL_TEST_UTIL_H_
8
9 #include "components/sync/engine_impl/syncer.h"
10 #include "components/sync/sessions_impl/sync_session.h"
11 #include "testing/gmock/include/gmock/gmock.h"
12 #include "testing/gtest/include/gtest/gtest.h"
13
14 namespace syncer {
15 namespace sessions {
16 namespace test_util {
17
18 // Configure sync cycle successes and failures.
19 void SimulateGetEncryptionKeyFailed(
20 ModelTypeSet requested_types,
21 sync_pb::GetUpdatesCallerInfo::GetUpdatesSource source,
22 sessions::SyncSession* session);
23 void SimulateConfigureSuccess(
24 ModelTypeSet requested_types,
25 sync_pb::GetUpdatesCallerInfo::GetUpdatesSource source,
26 sessions::SyncSession* session);
27 void SimulateConfigureFailed(
28 ModelTypeSet requested_types,
29 sync_pb::GetUpdatesCallerInfo::GetUpdatesSource source,
30 sessions::SyncSession* session);
31 void SimulateConfigureConnectionFailure(
32 ModelTypeSet requested_types,
33 sync_pb::GetUpdatesCallerInfo::GetUpdatesSource source,
34 sessions::SyncSession* session);
35
36 // Normal mode sync cycle successes and failures.
37 void SimulateNormalSuccess(ModelTypeSet requested_types,
38 sessions::NudgeTracker* nudge_tracker,
39 sessions::SyncSession* session);
40 void SimulateDownloadUpdatesFailed(ModelTypeSet requested_types,
41 sessions::NudgeTracker* nudge_tracker,
42 sessions::SyncSession* session);
43 void SimulateCommitFailed(ModelTypeSet requested_types,
44 sessions::NudgeTracker* nudge_tracker,
45 sessions::SyncSession* session);
46 void SimulateConnectionFailure(ModelTypeSet requested_types,
47 sessions::NudgeTracker* nudge_tracker,
48 sessions::SyncSession* session);
49
50 // Poll successes and failures.
51 void SimulatePollSuccess(ModelTypeSet requested_types,
52 sessions::SyncSession* session);
53 void SimulatePollFailed(ModelTypeSet requested_types,
54 sessions::SyncSession* session);
55
56 void SimulateGuRetryDelayCommandImpl(sessions::SyncSession* session,
57 base::TimeDelta delay);
58
59 void SimulateThrottledImpl(sessions::SyncSession* session,
60 const base::TimeDelta& delta);
61
62 void SimulateTypesThrottledImpl(sessions::SyncSession* session,
63 ModelTypeSet types,
64 const base::TimeDelta& delta);
65
66 // Works with poll cycles.
67 void SimulatePollIntervalUpdateImpl(ModelTypeSet requested_types,
68 sessions::SyncSession* session,
69 const base::TimeDelta& new_poll);
70
71 // Works with normal cycles.
72 void SimulateSessionsCommitDelayUpdateImpl(
73 ModelTypeSet requested_types,
74 sessions::NudgeTracker* nudge_tracker,
75 sessions::SyncSession* session,
76 const base::TimeDelta& new_delay);
77
78 ACTION_P(SimulateThrottled, throttle) {
79 SimulateThrottledImpl(arg0, throttle);
80 }
81
82 ACTION_P2(SimulateTypesThrottled, types, throttle) {
83 SimulateTypesThrottledImpl(arg0, types, throttle);
84 }
85
86 ACTION_P(SimulatePollIntervalUpdate, poll) {
87 SimulatePollIntervalUpdateImpl(arg0, arg1, poll);
88 }
89
90 ACTION_P(SimulateSessionsCommitDelayUpdate, poll) {
91 SimulateSessionsCommitDelayUpdateImpl(arg0, arg1, arg2, poll);
92 }
93
94 ACTION_P(SimulateGuRetryDelayCommand, delay) {
95 SimulateGuRetryDelayCommandImpl(arg0, delay);
96 }
97
98 } // namespace test_util
99 } // namespace sessions
100 } // namespace syncer
101
102 #endif // COMPONENTS_SYNC_SESSIONS_IMPL_TEST_UTIL_H_
OLDNEW
« no previous file with comments | « components/sync/sessions_impl/sync_session_context.cc ('k') | components/sync/sessions_impl/test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698