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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 ModelSafeRoutingInfo routing_info; | 229 ModelSafeRoutingInfo routing_info; |
230 std::vector<ModelSafeWorker*> workers; | 230 std::vector<ModelSafeWorker*> workers; |
231 | 231 |
232 GetModelSafeRoutingInfo(&routing_info); | 232 GetModelSafeRoutingInfo(&routing_info); |
233 GetWorkers(&workers); | 233 GetWorkers(&workers); |
234 | 234 |
235 throttled_data_type_tracker_.reset(new ThrottledDataTypeTracker(NULL)); | 235 throttled_data_type_tracker_.reset(new ThrottledDataTypeTracker(NULL)); |
236 | 236 |
237 context_.reset( | 237 context_.reset( |
238 new SyncSessionContext( | 238 new SyncSessionContext( |
239 mock_server_.get(), directory(), routing_info, workers, | 239 mock_server_.get(), directory(), workers, |
240 &extensions_activity_monitor_, throttled_data_type_tracker_.get(), | 240 &extensions_activity_monitor_, throttled_data_type_tracker_.get(), |
241 listeners, NULL, &traffic_recorder_)); | 241 listeners, NULL, &traffic_recorder_)); |
| 242 context_->set_routing_info(routing_info); |
242 ASSERT_FALSE(context_->resolver()); | 243 ASSERT_FALSE(context_->resolver()); |
243 syncer_ = new Syncer(); | 244 syncer_ = new Syncer(); |
244 session_.reset(MakeSession()); | 245 session_.reset(MakeSession()); |
245 | 246 |
246 syncable::ReadTransaction trans(FROM_HERE, directory()); | 247 syncable::ReadTransaction trans(FROM_HERE, directory()); |
247 syncable::Directory::ChildHandles children; | 248 syncable::Directory::ChildHandles children; |
248 directory()->GetChildHandlesById(&trans, trans.root_id(), &children); | 249 directory()->GetChildHandlesById(&trans, trans.root_id(), &children); |
249 ASSERT_EQ(0u, children.size()); | 250 ASSERT_EQ(0u, children.size()); |
250 saw_syncer_event_ = false; | 251 saw_syncer_event_ = false; |
251 root_id_ = TestIdFactory::root(); | 252 root_id_ = TestIdFactory::root(); |
(...skipping 4571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4823 | 4824 |
4824 TEST_F(SyncerPositionTiebreakingTest, MidLowHigh) { | 4825 TEST_F(SyncerPositionTiebreakingTest, MidLowHigh) { |
4825 Add(mid_id_); | 4826 Add(mid_id_); |
4826 Add(low_id_); | 4827 Add(low_id_); |
4827 Add(high_id_); | 4828 Add(high_id_); |
4828 SyncShareNudge(); | 4829 SyncShareNudge(); |
4829 ExpectLocalOrderIsByServerId(); | 4830 ExpectLocalOrderIsByServerId(); |
4830 } | 4831 } |
4831 | 4832 |
4832 } // namespace syncer | 4833 } // namespace syncer |
OLD | NEW |