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