| 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 // Syncer unit tests. Unfortunately a lot of these tests | 5 // Syncer unit tests. Unfortunately a lot of these tests |
| 6 // are outdated and need to be reworked and updated. | 6 // are outdated and need to be reworked and updated. |
| 7 | 7 |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <list> | 10 #include <list> |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 #include "build/build_config.h" | 25 #include "build/build_config.h" |
| 26 #include "sync/engine/get_commit_ids_command.h" | 26 #include "sync/engine/get_commit_ids_command.h" |
| 27 #include "sync/engine/net/server_connection_manager.h" | 27 #include "sync/engine/net/server_connection_manager.h" |
| 28 #include "sync/engine/process_updates_command.h" | 28 #include "sync/engine/process_updates_command.h" |
| 29 #include "sync/engine/sync_scheduler.h" | 29 #include "sync/engine/sync_scheduler.h" |
| 30 #include "sync/engine/syncer.h" | 30 #include "sync/engine/syncer.h" |
| 31 #include "sync/engine/syncer_proto_util.h" | 31 #include "sync/engine/syncer_proto_util.h" |
| 32 #include "sync/engine/syncproto.h" | 32 #include "sync/engine/syncproto.h" |
| 33 #include "sync/engine/throttled_data_type_tracker.h" | 33 #include "sync/engine/throttled_data_type_tracker.h" |
| 34 #include "sync/engine/traffic_recorder.h" | 34 #include "sync/engine/traffic_recorder.h" |
| 35 #include "sync/internal_api/public/base/model_type.h" |
| 35 #include "sync/internal_api/public/engine/model_safe_worker.h" | 36 #include "sync/internal_api/public/engine/model_safe_worker.h" |
| 36 #include "sync/internal_api/public/syncable/model_type.h" | |
| 37 #include "sync/protocol/bookmark_specifics.pb.h" | 37 #include "sync/protocol/bookmark_specifics.pb.h" |
| 38 #include "sync/protocol/nigori_specifics.pb.h" | 38 #include "sync/protocol/nigori_specifics.pb.h" |
| 39 #include "sync/protocol/preference_specifics.pb.h" | 39 #include "sync/protocol/preference_specifics.pb.h" |
| 40 #include "sync/protocol/sync.pb.h" | 40 #include "sync/protocol/sync.pb.h" |
| 41 #include "sync/sessions/sync_session_context.h" | 41 #include "sync/sessions/sync_session_context.h" |
| 42 #include "sync/syncable/mutable_entry.h" | 42 #include "sync/syncable/mutable_entry.h" |
| 43 #include "sync/syncable/nigori_util.h" | 43 #include "sync/syncable/nigori_util.h" |
| 44 #include "sync/syncable/read_transaction.h" | 44 #include "sync/syncable/read_transaction.h" |
| 45 #include "sync/syncable/syncable_util.h" | 45 #include "sync/syncable/syncable_util.h" |
| 46 #include "sync/syncable/write_transaction.h" | 46 #include "sync/syncable/write_transaction.h" |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 } | 172 } |
| 173 saw_syncer_event_ = true; | 173 saw_syncer_event_ = true; |
| 174 } | 174 } |
| 175 | 175 |
| 176 SyncSession* MakeSession() { | 176 SyncSession* MakeSession() { |
| 177 ModelSafeRoutingInfo info; | 177 ModelSafeRoutingInfo info; |
| 178 std::vector<ModelSafeWorker*> workers; | 178 std::vector<ModelSafeWorker*> workers; |
| 179 GetModelSafeRoutingInfo(&info); | 179 GetModelSafeRoutingInfo(&info); |
| 180 GetWorkers(&workers); | 180 GetWorkers(&workers); |
| 181 syncable::ModelTypePayloadMap types = | 181 syncable::ModelTypePayloadMap types = |
| 182 syncable::ModelTypePayloadMapFromRoutingInfo(info, std::string()); | 182 ModelSafeRoutingInfoToPayloadMap(info, std::string()); |
| 183 return new SyncSession(context_.get(), this, | 183 return new SyncSession(context_.get(), this, |
| 184 sessions::SyncSourceInfo(sync_pb::GetUpdatesCallerInfo::UNKNOWN, types), | 184 sessions::SyncSourceInfo(sync_pb::GetUpdatesCallerInfo::UNKNOWN, types), |
| 185 info, workers); | 185 info, workers); |
| 186 } | 186 } |
| 187 | 187 |
| 188 bool SyncShareAsDelegate( | 188 bool SyncShareAsDelegate( |
| 189 SyncScheduler::SyncSessionJob::SyncSessionJobPurpose purpose) { | 189 SyncScheduler::SyncSessionJob::SyncSessionJobPurpose purpose) { |
| 190 SyncerStep start; | 190 SyncerStep start; |
| 191 SyncerStep end; | 191 SyncerStep end; |
| 192 SyncScheduler::SetSyncerStepsForPurpose(purpose, &start, &end); | 192 SyncScheduler::SetSyncerStepsForPurpose(purpose, &start, &end); |
| (...skipping 4632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4825 | 4825 |
| 4826 TEST_F(SyncerPositionTiebreakingTest, MidLowHigh) { | 4826 TEST_F(SyncerPositionTiebreakingTest, MidLowHigh) { |
| 4827 Add(mid_id_); | 4827 Add(mid_id_); |
| 4828 Add(low_id_); | 4828 Add(low_id_); |
| 4829 Add(high_id_); | 4829 Add(high_id_); |
| 4830 SyncShareNudge(); | 4830 SyncShareNudge(); |
| 4831 ExpectLocalOrderIsByServerId(); | 4831 ExpectLocalOrderIsByServerId(); |
| 4832 } | 4832 } |
| 4833 | 4833 |
| 4834 } // namespace syncer | 4834 } // namespace syncer |
| OLD | NEW |