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

Side by Side Diff: sync/test/engine/syncer_command_test.h

Issue 19982002: sync: Remove SyncSourceInfo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Convert SyncShareRecords to typedef Created 7 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 | Annotate | Revision Log
« no previous file with comments | « sync/sync_tests.gypi ('k') | no next file » | 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 #ifndef SYNC_TEST_ENGINE_SYNCER_COMMAND_TEST_H_ 5 #ifndef SYNC_TEST_ENGINE_SYNCER_COMMAND_TEST_H_
6 #define SYNC_TEST_ENGINE_SYNCER_COMMAND_TEST_H_ 6 #define SYNC_TEST_ENGINE_SYNCER_COMMAND_TEST_H_
7 7
8 #include <algorithm> 8 #include <algorithm>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 96
97 virtual ~SyncerCommandTestBase(); 97 virtual ~SyncerCommandTestBase();
98 virtual void SetUp(); 98 virtual void SetUp();
99 virtual void TearDown(); 99 virtual void TearDown();
100 100
101 sessions::SyncSessionContext* context() const { return context_.get(); } 101 sessions::SyncSessionContext* context() const { return context_.get(); }
102 sessions::SyncSession::Delegate* delegate() { return this; } 102 sessions::SyncSession::Delegate* delegate() { return this; }
103 103
104 // Lazily create a session requesting all datatypes with no state. 104 // Lazily create a session requesting all datatypes with no state.
105 sessions::SyncSession* session() { 105 sessions::SyncSession* session() {
106 ModelTypeInvalidationMap types = 106 if (!session_.get())
107 ModelSafeRoutingInfoToInvalidationMap(routing_info_, std::string()); 107 session_.reset(sessions::SyncSession::Build(context(), delegate()));
108 return session(sessions::SyncSourceInfo(types));
109 }
110
111 // Create a session with the provided source.
112 sessions::SyncSession* session(const sessions::SyncSourceInfo& source) {
113 // These sources require a valid nudge tracker.
114 DCHECK_NE(sync_pb::GetUpdatesCallerInfo::LOCAL, source.updates_source);
115 DCHECK_NE(sync_pb::GetUpdatesCallerInfo::NOTIFICATION,
116 source.updates_source);
117 DCHECK_NE(sync_pb::GetUpdatesCallerInfo::DATATYPE_REFRESH,
118 source.updates_source);
119 if (!session_.get()) {
120 std::vector<ModelSafeWorker*> workers = GetWorkers();
121 session_.reset(
122 sessions::SyncSession::Build(context(), delegate(), source));
123 }
124 return session_.get(); 108 return session_.get();
125 } 109 }
126 110
127 void ClearSession() { 111 void ClearSession() {
128 session_.reset(); 112 session_.reset();
129 } 113 }
130 114
131 void ResetContext() { 115 void ResetContext() {
132 context_.reset(new sessions::SyncSessionContext( 116 context_.reset(new sessions::SyncSessionContext(
133 mock_server_.get(), directory(), 117 mock_server_.get(), directory(),
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 virtual void TearDown() OVERRIDE; 205 virtual void TearDown() OVERRIDE;
222 virtual syncable::Directory* directory() OVERRIDE; 206 virtual syncable::Directory* directory() OVERRIDE;
223 207
224 private: 208 private:
225 TestDirectorySetterUpper dir_maker_; 209 TestDirectorySetterUpper dir_maker_;
226 }; 210 };
227 211
228 } // namespace syncer 212 } // namespace syncer
229 213
230 #endif // SYNC_TEST_ENGINE_SYNCER_COMMAND_TEST_H_ 214 #endif // SYNC_TEST_ENGINE_SYNCER_COMMAND_TEST_H_
OLDNEW
« no previous file with comments | « sync/sync_tests.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698