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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 | 100 |
101 std::vector<ModelSafeWorker*> workers; | 101 std::vector<ModelSafeWorker*> workers; |
102 for (std::vector<scoped_refptr<FakeModelWorker> >::iterator it = | 102 for (std::vector<scoped_refptr<FakeModelWorker> >::iterator it = |
103 workers_.begin(); it != workers_.end(); ++it) { | 103 workers_.begin(); it != workers_.end(); ++it) { |
104 workers.push_back(it->get()); | 104 workers.push_back(it->get()); |
105 } | 105 } |
106 | 106 |
107 connection_.reset(new MockConnectionManager(directory())); | 107 connection_.reset(new MockConnectionManager(directory())); |
108 connection_->SetServerReachable(); | 108 connection_->SetServerReachable(); |
109 context_.reset(new SyncSessionContext( | 109 context_.reset(new SyncSessionContext( |
110 connection_.get(), directory(), routing_info, workers, | 110 connection_.get(), directory(), workers, |
111 &extensions_activity_monitor_, | 111 &extensions_activity_monitor_, |
112 std::vector<SyncEngineEventListener*>(), NULL, NULL)); | 112 std::vector<SyncEngineEventListener*>(), NULL, NULL)); |
113 context_->set_notifications_enabled(true); | 113 context_->set_notifications_enabled(true); |
114 context_->set_account_name("Test"); | 114 context_->set_account_name("Test"); |
| 115 context_->set_routing_info(routing_info); |
115 scheduler_.reset( | 116 scheduler_.reset( |
116 new SyncScheduler("TestSyncScheduler", context(), syncer_)); | 117 new SyncScheduler("TestSyncScheduler", context(), syncer_)); |
117 } | 118 } |
118 | 119 |
119 SyncScheduler* scheduler() { return scheduler_.get(); } | 120 SyncScheduler* scheduler() { return scheduler_.get(); } |
120 MockSyncer* syncer() { return syncer_; } | 121 MockSyncer* syncer() { return syncer_; } |
121 MockDelayProvider* delay() { return delay_; } | 122 MockDelayProvider* delay() { return delay_; } |
122 MockConnectionManager* connection() { return connection_.get(); } | 123 MockConnectionManager* connection() { return connection_.get(); } |
123 TimeDelta zero() { return TimeDelta::FromSeconds(0); } | 124 TimeDelta zero() { return TimeDelta::FromSeconds(0); } |
124 TimeDelta timeout() { | 125 TimeDelta timeout() { |
(...skipping 1040 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1165 PumpLoop(); | 1166 PumpLoop(); |
1166 // Pump again to run job. | 1167 // Pump again to run job. |
1167 PumpLoop(); | 1168 PumpLoop(); |
1168 | 1169 |
1169 StopSyncScheduler(); | 1170 StopSyncScheduler(); |
1170 | 1171 |
1171 EXPECT_TRUE(expected == context()->previous_session_routing_info()); | 1172 EXPECT_TRUE(expected == context()->previous_session_routing_info()); |
1172 } | 1173 } |
1173 | 1174 |
1174 } // namespace browser_sync | 1175 } // namespace browser_sync |
OLD | NEW |