OLD | NEW |
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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 | 93 |
94 virtual ~SyncerCommandTestBase(); | 94 virtual ~SyncerCommandTestBase(); |
95 virtual void SetUp(); | 95 virtual void SetUp(); |
96 virtual void TearDown(); | 96 virtual void TearDown(); |
97 | 97 |
98 sessions::SyncSessionContext* context() const { return context_.get(); } | 98 sessions::SyncSessionContext* context() const { return context_.get(); } |
99 sessions::SyncSession::Delegate* delegate() { return this; } | 99 sessions::SyncSession::Delegate* delegate() { return this; } |
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 ModelTypeStateMap types = | 103 ModelTypeInvalidationMap types = |
104 ModelSafeRoutingInfoToStateMap(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_.get()) { | 110 if (!session_.get()) { |
111 std::vector<ModelSafeWorker*> workers = GetWorkers(); | 111 std::vector<ModelSafeWorker*> workers = GetWorkers(); |
112 session_.reset(new sessions::SyncSession(context(), delegate(), source, | 112 session_.reset(new sessions::SyncSession(context(), delegate(), source, |
113 routing_info_, workers)); | 113 routing_info_, workers)); |
114 } | 114 } |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 | 228 |
229 virtual void SetUp() OVERRIDE; | 229 virtual void SetUp() OVERRIDE; |
230 | 230 |
231 TestUnrecoverableErrorHandler handler_; | 231 TestUnrecoverableErrorHandler handler_; |
232 syncable::MockDirectory mock_directory_; | 232 syncable::MockDirectory mock_directory_; |
233 }; | 233 }; |
234 | 234 |
235 } // namespace syncer | 235 } // namespace syncer |
236 | 236 |
237 #endif // SYNC_TEST_ENGINE_SYNCER_COMMAND_TEST_H_ | 237 #endif // SYNC_TEST_ENGINE_SYNCER_COMMAND_TEST_H_ |
OLD | NEW |