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

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

Issue 10825439: sync: remove buggy freshness condition in SyncSchedulerImpl add defensive DCHECKs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: init 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 65
66 virtual void TearDown() { 66 virtual void TearDown() {
67 scheduler_.reset(); 67 scheduler_.reset();
68 } 68 }
69 69
70 void SetMode(SyncScheduler::Mode mode) { 70 void SetMode(SyncScheduler::Mode mode) {
71 scheduler_->mode_ = mode; 71 scheduler_->mode_ = mode;
72 } 72 }
73 73
74 void SetLastSyncedTime(base::TimeTicks ticks) { 74 void SetLastSyncedTime(base::TimeTicks ticks) {
75 scheduler_->last_sync_session_end_time_ = ticks; 75 scheduler_->last_nudge_or_poll_end_time_ = ticks;
76 } 76 }
77 77
78 void ResetWaitInterval() { 78 void ResetWaitInterval() {
79 scheduler_->wait_interval_.reset(); 79 scheduler_->wait_interval_.reset();
80 } 80 }
81 81
82 void SetWaitIntervalToThrottled() { 82 void SetWaitIntervalToThrottled() {
83 scheduler_->wait_interval_.reset(new SyncSchedulerImpl::WaitInterval( 83 scheduler_->wait_interval_.reset(new SyncSchedulerImpl::WaitInterval(
84 SyncSchedulerImpl::WaitInterval::THROTTLED, TimeDelta::FromSeconds(1))); 84 SyncSchedulerImpl::WaitInterval::THROTTLED, TimeDelta::FromSeconds(1)));
85 } 85 }
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 struct SyncSchedulerImpl::SyncSessionJob job; 267 struct SyncSchedulerImpl::SyncSessionJob job;
268 job.purpose = SyncSchedulerImpl::SyncSessionJob::CONFIGURATION; 268 job.purpose = SyncSchedulerImpl::SyncSessionJob::CONFIGURATION;
269 job.scheduled_start = TimeTicks::Now(); 269 job.scheduled_start = TimeTicks::Now();
270 job.is_canary_job = true; 270 job.is_canary_job = true;
271 SyncSchedulerImpl::JobProcessDecision decision = DecideOnJob(job); 271 SyncSchedulerImpl::JobProcessDecision decision = DecideOnJob(job);
272 272
273 EXPECT_EQ(decision, SyncSchedulerImpl::CONTINUE); 273 EXPECT_EQ(decision, SyncSchedulerImpl::CONTINUE);
274 } 274 }
275 275
276 } // namespace syncer 276 } // namespace syncer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698