Chromium Code Reviews| 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/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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 167 | 167 |
| 168 TEST_F(SyncSchedulerWhiteboxTest, ContinueNudge) { | 168 TEST_F(SyncSchedulerWhiteboxTest, ContinueNudge) { |
| 169 InitializeSyncerOnNormalMode(); | 169 InitializeSyncerOnNormalMode(); |
| 170 | 170 |
| 171 SyncSchedulerImpl::JobProcessDecision decision = CreateAndDecideJob( | 171 SyncSchedulerImpl::JobProcessDecision decision = CreateAndDecideJob( |
| 172 SyncSessionJob::NUDGE); | 172 SyncSessionJob::NUDGE); |
| 173 | 173 |
| 174 EXPECT_EQ(decision, SyncSchedulerImpl::CONTINUE); | 174 EXPECT_EQ(decision, SyncSchedulerImpl::CONTINUE); |
| 175 } | 175 } |
| 176 | 176 |
| 177 TEST_F(SyncSchedulerWhiteboxTest, DropPoll) { | |
|
rlarocque
2013/03/18 22:02:18
I think it's safe to drop these tests, since the l
| |
| 178 InitializeSyncerOnNormalMode(); | |
| 179 SetMode(SyncScheduler::CONFIGURATION_MODE); | |
| 180 | |
| 181 SyncSchedulerImpl::JobProcessDecision decision = CreateAndDecideJob( | |
| 182 SyncSessionJob::POLL); | |
| 183 | |
| 184 EXPECT_EQ(decision, SyncSchedulerImpl::DROP); | |
| 185 } | |
| 186 | |
| 187 TEST_F(SyncSchedulerWhiteboxTest, ContinuePoll) { | |
| 188 InitializeSyncerOnNormalMode(); | |
| 189 | |
| 190 SyncSchedulerImpl::JobProcessDecision decision = CreateAndDecideJob( | |
| 191 SyncSessionJob::POLL); | |
| 192 | |
| 193 EXPECT_EQ(decision, SyncSchedulerImpl::CONTINUE); | |
| 194 } | |
| 195 | |
| 196 TEST_F(SyncSchedulerWhiteboxTest, ContinueConfiguration) { | 177 TEST_F(SyncSchedulerWhiteboxTest, ContinueConfiguration) { |
| 197 InitializeSyncerOnNormalMode(); | 178 InitializeSyncerOnNormalMode(); |
| 198 SetMode(SyncScheduler::CONFIGURATION_MODE); | 179 SetMode(SyncScheduler::CONFIGURATION_MODE); |
| 199 | 180 |
| 200 SyncSchedulerImpl::JobProcessDecision decision = CreateAndDecideJob( | 181 SyncSchedulerImpl::JobProcessDecision decision = CreateAndDecideJob( |
| 201 SyncSessionJob::CONFIGURATION); | 182 SyncSessionJob::CONFIGURATION); |
| 202 | 183 |
| 203 EXPECT_EQ(decision, SyncSchedulerImpl::CONTINUE); | 184 EXPECT_EQ(decision, SyncSchedulerImpl::CONTINUE); |
| 204 } | 185 } |
| 205 | 186 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 259 TimeTicks::Now(), scoped_ptr<SyncSession>(), | 240 TimeTicks::Now(), scoped_ptr<SyncSession>(), |
| 260 ConfigurationParams()); | 241 ConfigurationParams()); |
| 261 | 242 |
| 262 SyncSchedulerImpl::JobProcessDecision decision = | 243 SyncSchedulerImpl::JobProcessDecision decision = |
| 263 DecideOnJob(job, SyncSchedulerImpl::CANARY_PRIORITY); | 244 DecideOnJob(job, SyncSchedulerImpl::CANARY_PRIORITY); |
| 264 | 245 |
| 265 EXPECT_EQ(decision, SyncSchedulerImpl::CONTINUE); | 246 EXPECT_EQ(decision, SyncSchedulerImpl::CONTINUE); |
| 266 } | 247 } |
| 267 | 248 |
| 268 } // namespace syncer | 249 } // namespace syncer |
| OLD | NEW |