Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Side by Side Diff: sync/engine/sync_scheduler_whitebox_unittest.cc

Issue 10832286: sync: Introduce control data types (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/backoff_delay_provider.h" 7 #include "sync/engine/backoff_delay_provider.h"
8 #include "sync/engine/sync_scheduler_impl.h" 8 #include "sync/engine/sync_scheduler_impl.h"
9 #include "sync/engine/throttled_data_type_tracker.h" 9 #include "sync/engine/throttled_data_type_tracker.h"
10 #include "sync/internal_api/public/engine/polling_constants.h" 10 #include "sync/internal_api/public/engine/polling_constants.h"
(...skipping 16 matching lines...) Expand all
27 using sync_pb::GetUpdatesCallerInfo; 27 using sync_pb::GetUpdatesCallerInfo;
28 28
29 class SyncSchedulerWhiteboxTest : public testing::Test { 29 class SyncSchedulerWhiteboxTest : public testing::Test {
30 public: 30 public:
31 virtual void SetUp() { 31 virtual void SetUp() {
32 dir_maker_.SetUp(); 32 dir_maker_.SetUp();
33 Syncer* syncer = new Syncer(); 33 Syncer* syncer = new Syncer();
34 34
35 ModelSafeRoutingInfo routes; 35 ModelSafeRoutingInfo routes;
36 routes[BOOKMARKS] = GROUP_UI; 36 routes[BOOKMARKS] = GROUP_UI;
37 routes[NIGORI] = GROUP_PASSIVE; 37 routes[NIGORI] = GROUP_CONTROL;
38 38
39 workers_.push_back(make_scoped_refptr(new FakeModelWorker(GROUP_UI))); 39 workers_.push_back(make_scoped_refptr(new FakeModelWorker(GROUP_UI)));
40 workers_.push_back(make_scoped_refptr(new FakeModelWorker(GROUP_PASSIVE))); 40 workers_.push_back(make_scoped_refptr(new FakeModelWorker(GROUP_PASSIVE)));
41 workers_.push_back(make_scoped_refptr(new FakeModelWorker(GROUP_CONTROL)));
41 42
42 std::vector<ModelSafeWorker*> workers; 43 std::vector<ModelSafeWorker*> workers;
43 for (std::vector<scoped_refptr<FakeModelWorker> >::iterator it = 44 for (std::vector<scoped_refptr<FakeModelWorker> >::iterator it =
44 workers_.begin(); it != workers_.end(); ++it) { 45 workers_.begin(); it != workers_.end(); ++it) {
45 workers.push_back(it->get()); 46 workers.push_back(it->get());
46 } 47 }
47 48
48 connection_.reset(new MockConnectionManager(NULL)); 49 connection_.reset(new MockConnectionManager(NULL));
49 throttled_data_type_tracker_.reset(new ThrottledDataTypeTracker(NULL)); 50 throttled_data_type_tracker_.reset(new ThrottledDataTypeTracker(NULL));
50 context_.reset( 51 context_.reset(
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 struct SyncSchedulerImpl::SyncSessionJob job; 268 struct SyncSchedulerImpl::SyncSessionJob job;
268 job.purpose = SyncSchedulerImpl::SyncSessionJob::CONFIGURATION; 269 job.purpose = SyncSchedulerImpl::SyncSessionJob::CONFIGURATION;
269 job.scheduled_start = TimeTicks::Now(); 270 job.scheduled_start = TimeTicks::Now();
270 job.is_canary_job = true; 271 job.is_canary_job = true;
271 SyncSchedulerImpl::JobProcessDecision decision = DecideOnJob(job); 272 SyncSchedulerImpl::JobProcessDecision decision = DecideOnJob(job);
272 273
273 EXPECT_EQ(decision, SyncSchedulerImpl::CONTINUE); 274 EXPECT_EQ(decision, SyncSchedulerImpl::CONTINUE);
274 } 275 }
275 276
276 } // namespace syncer 277 } // namespace syncer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698