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 #include "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/callback.h" | 6 #include "base/callback.h" |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/test/test_timeouts.h" | 10 #include "base/test/test_timeouts.h" |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 std::vector<ModelSafeWorker*> workers; | 111 std::vector<ModelSafeWorker*> workers; |
112 for (std::vector<scoped_refptr<FakeModelWorker> >::iterator it = | 112 for (std::vector<scoped_refptr<FakeModelWorker> >::iterator it = |
113 workers_.begin(); it != workers_.end(); ++it) { | 113 workers_.begin(); it != workers_.end(); ++it) { |
114 workers.push_back(it->get()); | 114 workers.push_back(it->get()); |
115 } | 115 } |
116 | 116 |
117 connection_.reset(new MockConnectionManager(directory())); | 117 connection_.reset(new MockConnectionManager(directory())); |
118 connection_->SetServerReachable(); | 118 connection_->SetServerReachable(); |
119 throttled_data_type_tracker_.reset(new ThrottledDataTypeTracker(NULL)); | 119 throttled_data_type_tracker_.reset(new ThrottledDataTypeTracker(NULL)); |
120 context_.reset(new SyncSessionContext( | 120 context_.reset(new SyncSessionContext( |
121 connection_.get(), directory(), routing_info, workers, | 121 connection_.get(), directory(), workers, |
122 &extensions_activity_monitor_, throttled_data_type_tracker_.get(), | 122 &extensions_activity_monitor_, throttled_data_type_tracker_.get(), |
123 std::vector<SyncEngineEventListener*>(), NULL, NULL)); | 123 std::vector<SyncEngineEventListener*>(), NULL, NULL)); |
| 124 context_->set_routing_info(routing_info); |
124 context_->set_notifications_enabled(true); | 125 context_->set_notifications_enabled(true); |
125 context_->set_account_name("Test"); | 126 context_->set_account_name("Test"); |
126 scheduler_.reset( | 127 scheduler_.reset( |
127 new SyncSchedulerImpl("TestSyncScheduler", context(), syncer_)); | 128 new SyncSchedulerImpl("TestSyncScheduler", context(), syncer_)); |
128 } | 129 } |
129 | 130 |
130 SyncSchedulerImpl* scheduler() { return scheduler_.get(); } | 131 SyncSchedulerImpl* scheduler() { return scheduler_.get(); } |
131 MockSyncer* syncer() { return syncer_; } | 132 MockSyncer* syncer() { return syncer_; } |
132 MockDelayProvider* delay() { return delay_; } | 133 MockDelayProvider* delay() { return delay_; } |
133 MockConnectionManager* connection() { return connection_.get(); } | 134 MockConnectionManager* connection() { return connection_.get(); } |
(...skipping 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1176 PumpLoop(); | 1177 PumpLoop(); |
1177 // Pump again to run job. | 1178 // Pump again to run job. |
1178 PumpLoop(); | 1179 PumpLoop(); |
1179 | 1180 |
1180 StopSyncScheduler(); | 1181 StopSyncScheduler(); |
1181 | 1182 |
1182 EXPECT_TRUE(expected == context()->previous_session_routing_info()); | 1183 EXPECT_TRUE(expected == context()->previous_session_routing_info()); |
1183 } | 1184 } |
1184 | 1185 |
1185 } // namespace syncer | 1186 } // namespace syncer |
OLD | NEW |