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/message_loop.h" | 5 #include "base/message_loop.h" |
6 #include "base/time.h" | 6 #include "base/time.h" |
7 #include "sync/engine/sync_scheduler.h" | 7 #include "sync/engine/sync_scheduler.h" |
8 #include "sync/sessions/sync_session_context.h" | 8 #include "sync/sessions/sync_session_context.h" |
9 #include "sync/sessions/test_util.h" | 9 #include "sync/sessions/test_util.h" |
10 #include "sync/test/engine/fake_model_worker.h" | 10 #include "sync/test/engine/fake_model_worker.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 std::vector<ModelSafeWorker*> workers; | 40 std::vector<ModelSafeWorker*> workers; |
41 for (std::vector<scoped_refptr<FakeModelWorker> >::iterator it = | 41 for (std::vector<scoped_refptr<FakeModelWorker> >::iterator it = |
42 workers_.begin(); it != workers_.end(); ++it) { | 42 workers_.begin(); it != workers_.end(); ++it) { |
43 workers.push_back(it->get()); | 43 workers.push_back(it->get()); |
44 } | 44 } |
45 | 45 |
46 connection_.reset(new MockConnectionManager(NULL)); | 46 connection_.reset(new MockConnectionManager(NULL)); |
47 context_.reset( | 47 context_.reset( |
48 new SyncSessionContext( | 48 new SyncSessionContext( |
49 connection_.get(), dir_maker_.directory(), | 49 connection_.get(), dir_maker_.directory(), |
50 routes, workers, &extensions_activity_monitor_, | 50 workers, &extensions_activity_monitor_, |
51 std::vector<SyncEngineEventListener*>(), NULL, NULL)); | 51 std::vector<SyncEngineEventListener*>(), NULL, NULL)); |
52 context_->set_notifications_enabled(true); | 52 context_->set_notifications_enabled(true); |
53 context_->set_account_name("Test"); | 53 context_->set_account_name("Test"); |
54 scheduler_.reset( | 54 scheduler_.reset( |
55 new SyncScheduler("TestSyncSchedulerWhitebox", context(), syncer)); | 55 new SyncScheduler("TestSyncSchedulerWhitebox", context(), syncer)); |
56 } | 56 } |
57 | 57 |
58 virtual void TearDown() { | 58 virtual void TearDown() { |
59 scheduler_.reset(); | 59 scheduler_.reset(); |
60 } | 60 } |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 struct SyncScheduler::SyncSessionJob job; | 272 struct SyncScheduler::SyncSessionJob job; |
273 job.purpose = SyncScheduler::SyncSessionJob::CONFIGURATION; | 273 job.purpose = SyncScheduler::SyncSessionJob::CONFIGURATION; |
274 job.scheduled_start = TimeTicks::Now(); | 274 job.scheduled_start = TimeTicks::Now(); |
275 job.is_canary_job = true; | 275 job.is_canary_job = true; |
276 SyncScheduler::JobProcessDecision decision = DecideOnJob(job); | 276 SyncScheduler::JobProcessDecision decision = DecideOnJob(job); |
277 | 277 |
278 EXPECT_EQ(decision, SyncScheduler::CONTINUE); | 278 EXPECT_EQ(decision, SyncScheduler::CONTINUE); |
279 } | 279 } |
280 | 280 |
281 } // namespace browser_sync | 281 } // namespace browser_sync |
OLD | NEW |