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

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

Issue 14963002: sync: Report GetUpdate triggers to the server (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review response: lots of renames Created 7 years, 7 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
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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 100
101 // Lazily create a session requesting all datatypes with no state. 101 // Lazily create a session requesting all datatypes with no state.
102 sessions::SyncSession* session() { 102 sessions::SyncSession* session() {
103 ModelTypeInvalidationMap types = 103 ModelTypeInvalidationMap types =
104 ModelSafeRoutingInfoToInvalidationMap(routing_info_, std::string()); 104 ModelSafeRoutingInfoToInvalidationMap(routing_info_, std::string());
105 return session(sessions::SyncSourceInfo(types)); 105 return session(sessions::SyncSourceInfo(types));
106 } 106 }
107 107
108 // Create a session with the provided source. 108 // Create a session with the provided source.
109 sessions::SyncSession* session(const sessions::SyncSourceInfo& source) { 109 sessions::SyncSession* session(const sessions::SyncSourceInfo& source) {
110 if (!session_) { 110 // These sources require a valid nudge tracker.
111 DCHECK_NE(sync_pb::GetUpdatesCallerInfo::LOCAL, source.updates_source);
112 DCHECK_NE(sync_pb::GetUpdatesCallerInfo::NOTIFICATION,
113 source.updates_source);
114 DCHECK_NE(sync_pb::GetUpdatesCallerInfo::DATATYPE_REFRESH,
115 source.updates_source);
116 if (!session_.get()) {
111 std::vector<ModelSafeWorker*> workers = GetWorkers(); 117 std::vector<ModelSafeWorker*> workers = GetWorkers();
112 session_.reset(new sessions::SyncSession(context(), delegate(), source)); 118 session_.reset(
119 sessions::SyncSession::BuildForNonNudge(
120 context(),
121 delegate(),
122 source));
113 } 123 }
114 return session_.get(); 124 return session_.get();
115 } 125 }
116 126
117 void ClearSession() { 127 void ClearSession() {
118 session_.reset(); 128 session_.reset();
119 } 129 }
120 130
121 void ResetContext() { 131 void ResetContext() {
122 throttled_data_type_tracker_.reset(new ThrottledDataTypeTracker(NULL)); 132 throttled_data_type_tracker_.reset(new ThrottledDataTypeTracker(NULL));
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 239
230 virtual void SetUp() OVERRIDE; 240 virtual void SetUp() OVERRIDE;
231 241
232 TestUnrecoverableErrorHandler handler_; 242 TestUnrecoverableErrorHandler handler_;
233 syncable::MockDirectory mock_directory_; 243 syncable::MockDirectory mock_directory_;
234 }; 244 };
235 245
236 } // namespace syncer 246 } // namespace syncer
237 247
238 #endif // SYNC_TEST_ENGINE_SYNCER_COMMAND_TEST_H_ 248 #endif // SYNC_TEST_ENGINE_SYNCER_COMMAND_TEST_H_
OLDNEW
« sync/sessions/sync_session.h ('K') | « sync/test/engine/fake_sync_scheduler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698