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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 ModelSafeRoutingInfo routing_info; | 228 ModelSafeRoutingInfo routing_info; |
229 std::vector<ModelSafeWorker*> workers; | 229 std::vector<ModelSafeWorker*> workers; |
230 | 230 |
231 GetModelSafeRoutingInfo(&routing_info); | 231 GetModelSafeRoutingInfo(&routing_info); |
232 GetWorkers(&workers); | 232 GetWorkers(&workers); |
233 | 233 |
234 throttled_data_type_tracker_.reset(new ThrottledDataTypeTracker(NULL)); | 234 throttled_data_type_tracker_.reset(new ThrottledDataTypeTracker(NULL)); |
235 | 235 |
236 context_.reset( | 236 context_.reset( |
237 new SyncSessionContext( | 237 new SyncSessionContext( |
238 mock_server_.get(), directory(), routing_info, workers, | 238 mock_server_.get(), directory(), workers, |
239 &extensions_activity_monitor_, throttled_data_type_tracker_.get(), | 239 &extensions_activity_monitor_, throttled_data_type_tracker_.get(), |
240 listeners, NULL, &traffic_recorder_)); | 240 listeners, NULL, &traffic_recorder_)); |
| 241 context_->set_routing_info(routing_info); |
241 ASSERT_FALSE(context_->resolver()); | 242 ASSERT_FALSE(context_->resolver()); |
242 syncer_ = new Syncer(); | 243 syncer_ = new Syncer(); |
243 session_.reset(MakeSession()); | 244 session_.reset(MakeSession()); |
244 | 245 |
245 syncable::ReadTransaction trans(FROM_HERE, directory()); | 246 syncable::ReadTransaction trans(FROM_HERE, directory()); |
246 syncable::Directory::ChildHandles children; | 247 syncable::Directory::ChildHandles children; |
247 directory()->GetChildHandlesById(&trans, trans.root_id(), &children); | 248 directory()->GetChildHandlesById(&trans, trans.root_id(), &children); |
248 ASSERT_EQ(0u, children.size()); | 249 ASSERT_EQ(0u, children.size()); |
249 saw_syncer_event_ = false; | 250 saw_syncer_event_ = false; |
250 root_id_ = TestIdFactory::root(); | 251 root_id_ = TestIdFactory::root(); |
(...skipping 4572 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 |