| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 virtual ~SyncerCommandTestBase(); | 95 virtual ~SyncerCommandTestBase(); |
| 96 virtual void SetUp(); | 96 virtual void SetUp(); |
| 97 virtual void TearDown(); | 97 virtual void TearDown(); |
| 98 | 98 |
| 99 sessions::SyncSessionContext* context() const { return context_.get(); } | 99 sessions::SyncSessionContext* context() const { return context_.get(); } |
| 100 sessions::SyncSession::Delegate* delegate() { return this; } | 100 sessions::SyncSession::Delegate* delegate() { return this; } |
| 101 | 101 |
| 102 // Lazily create a session requesting all datatypes with no payload. | 102 // Lazily create a session requesting all datatypes with no payload. |
| 103 sessions::SyncSession* session() { | 103 sessions::SyncSession* session() { |
| 104 syncable::ModelTypePayloadMap types = | 104 syncable::ModelTypePayloadMap types = |
| 105 syncable::ModelTypePayloadMapFromRoutingInfo(routing_info_, | 105 ModelSafeRoutingInfoToPayloadMap(routing_info_, std::string()); |
| 106 std::string()); | |
| 107 return session(sessions::SyncSourceInfo(types)); | 106 return session(sessions::SyncSourceInfo(types)); |
| 108 } | 107 } |
| 109 | 108 |
| 110 // Create a session with the provided source. | 109 // Create a session with the provided source. |
| 111 sessions::SyncSession* session(const sessions::SyncSourceInfo& source) { | 110 sessions::SyncSession* session(const sessions::SyncSourceInfo& source) { |
| 112 if (!session_.get()) { | 111 if (!session_.get()) { |
| 113 std::vector<ModelSafeWorker*> workers = GetWorkers(); | 112 std::vector<ModelSafeWorker*> workers = GetWorkers(); |
| 114 session_.reset(new sessions::SyncSession(context(), delegate(), source, | 113 session_.reset(new sessions::SyncSession(context(), delegate(), source, |
| 115 routing_info_, workers)); | 114 routing_info_, workers)); |
| 116 } | 115 } |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 | 228 |
| 230 virtual void SetUp() OVERRIDE; | 229 virtual void SetUp() OVERRIDE; |
| 231 | 230 |
| 232 TestUnrecoverableErrorHandler handler_; | 231 TestUnrecoverableErrorHandler handler_; |
| 233 syncable::MockDirectory mock_directory_; | 232 syncable::MockDirectory mock_directory_; |
| 234 }; | 233 }; |
| 235 | 234 |
| 236 } // namespace syncer | 235 } // namespace syncer |
| 237 | 236 |
| 238 #endif // SYNC_TEST_ENGINE_SYNCER_COMMAND_TEST_H_ | 237 #endif // SYNC_TEST_ENGINE_SYNCER_COMMAND_TEST_H_ |
| OLD | NEW |