| 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_impl.h" | 7 #include "sync/engine/sync_scheduler_impl.h" |
| 8 #include "sync/engine/throttled_data_type_tracker.h" | 8 #include "sync/engine/throttled_data_type_tracker.h" |
| 9 #include "sync/sessions/sync_session_context.h" | 9 #include "sync/sessions/sync_session_context.h" |
| 10 #include "sync/sessions/test_util.h" | 10 #include "sync/sessions/test_util.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 using sync_pb::GetUpdatesCallerInfo; | 25 using sync_pb::GetUpdatesCallerInfo; |
| 26 | 26 |
| 27 class SyncSchedulerWhiteboxTest : public testing::Test { | 27 class SyncSchedulerWhiteboxTest : public testing::Test { |
| 28 public: | 28 public: |
| 29 virtual void SetUp() { | 29 virtual void SetUp() { |
| 30 dir_maker_.SetUp(); | 30 dir_maker_.SetUp(); |
| 31 Syncer* syncer = new Syncer(); | 31 Syncer* syncer = new Syncer(); |
| 32 | 32 |
| 33 ModelSafeRoutingInfo routes; | 33 ModelSafeRoutingInfo routes; |
| 34 routes[BOOKMARKS] = GROUP_UI; | 34 routes[BOOKMARKS] = GROUP_UI; |
| 35 routes[NIGORI] = GROUP_PASSIVE; | 35 routes[NIGORI] = GROUP_CONTROL; |
| 36 | 36 |
| 37 workers_.push_back(make_scoped_refptr(new FakeModelWorker(GROUP_UI))); | 37 workers_.push_back(make_scoped_refptr(new FakeModelWorker(GROUP_UI))); |
| 38 workers_.push_back(make_scoped_refptr(new FakeModelWorker(GROUP_PASSIVE))); | 38 workers_.push_back(make_scoped_refptr(new FakeModelWorker(GROUP_PASSIVE))); |
| 39 workers_.push_back(make_scoped_refptr(new FakeModelWorker(GROUP_CONTROL))); |
| 39 | 40 |
| 40 std::vector<ModelSafeWorker*> workers; | 41 std::vector<ModelSafeWorker*> workers; |
| 41 for (std::vector<scoped_refptr<FakeModelWorker> >::iterator it = | 42 for (std::vector<scoped_refptr<FakeModelWorker> >::iterator it = |
| 42 workers_.begin(); it != workers_.end(); ++it) { | 43 workers_.begin(); it != workers_.end(); ++it) { |
| 43 workers.push_back(it->get()); | 44 workers.push_back(it->get()); |
| 44 } | 45 } |
| 45 | 46 |
| 46 connection_.reset(new MockConnectionManager(NULL)); | 47 connection_.reset(new MockConnectionManager(NULL)); |
| 47 throttled_data_type_tracker_.reset(new ThrottledDataTypeTracker(NULL)); | 48 throttled_data_type_tracker_.reset(new ThrottledDataTypeTracker(NULL)); |
| 48 context_.reset( | 49 context_.reset( |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 struct SyncSchedulerImpl::SyncSessionJob job; | 263 struct SyncSchedulerImpl::SyncSessionJob job; |
| 263 job.purpose = SyncSchedulerImpl::SyncSessionJob::CONFIGURATION; | 264 job.purpose = SyncSchedulerImpl::SyncSessionJob::CONFIGURATION; |
| 264 job.scheduled_start = TimeTicks::Now(); | 265 job.scheduled_start = TimeTicks::Now(); |
| 265 job.is_canary_job = true; | 266 job.is_canary_job = true; |
| 266 SyncSchedulerImpl::JobProcessDecision decision = DecideOnJob(job); | 267 SyncSchedulerImpl::JobProcessDecision decision = DecideOnJob(job); |
| 267 | 268 |
| 268 EXPECT_EQ(decision, SyncSchedulerImpl::CONTINUE); | 269 EXPECT_EQ(decision, SyncSchedulerImpl::CONTINUE); |
| 269 } | 270 } |
| 270 | 271 |
| 271 } // namespace syncer | 272 } // namespace syncer |
| OLD | NEW |