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

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

Issue 10584019: sync: Remove ClearUserData command. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix test Created 8 years, 6 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
« no previous file with comments | « sync/engine/sync_scheduler_unittest.cc ('k') | sync/engine/syncer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 SetMode(SyncScheduler::CONFIGURATION_MODE); 221 SetMode(SyncScheduler::CONFIGURATION_MODE);
222 222
223 SetWaitIntervalToThrottled(); 223 SetWaitIntervalToThrottled();
224 224
225 SyncScheduler::JobProcessDecision decision = CreateAndDecideJob( 225 SyncScheduler::JobProcessDecision decision = CreateAndDecideJob(
226 SyncScheduler::SyncSessionJob::NUDGE); 226 SyncScheduler::SyncSessionJob::NUDGE);
227 227
228 EXPECT_EQ(decision, SyncScheduler::SAVE); 228 EXPECT_EQ(decision, SyncScheduler::SAVE);
229 } 229 }
230 230
231 TEST_F(SyncSchedulerWhiteboxTest,
232 ContinueClearUserDataUnderAllCircumstances) {
233 InitializeSyncerOnNormalMode();
234
235 SetMode(SyncScheduler::CONFIGURATION_MODE);
236 SetWaitIntervalToThrottled();
237 SyncScheduler::JobProcessDecision decision = CreateAndDecideJob(
238 SyncScheduler::SyncSessionJob::CLEAR_USER_DATA);
239 EXPECT_EQ(decision, SyncScheduler::CONTINUE);
240
241 SetMode(SyncScheduler::NORMAL_MODE);
242 SetWaitIntervalToExponentialBackoff();
243 decision = CreateAndDecideJob(
244 SyncScheduler::SyncSessionJob::CLEAR_USER_DATA);
245 EXPECT_EQ(decision, SyncScheduler::CONTINUE);
246 }
247
248 TEST_F(SyncSchedulerWhiteboxTest, ContinueNudgeWhileExponentialBackOff) { 231 TEST_F(SyncSchedulerWhiteboxTest, ContinueNudgeWhileExponentialBackOff) {
249 InitializeSyncerOnNormalMode(); 232 InitializeSyncerOnNormalMode();
250 SetMode(SyncScheduler::NORMAL_MODE); 233 SetMode(SyncScheduler::NORMAL_MODE);
251 SetWaitIntervalToExponentialBackoff(); 234 SetWaitIntervalToExponentialBackoff();
252 235
253 SyncScheduler::JobProcessDecision decision = CreateAndDecideJob( 236 SyncScheduler::JobProcessDecision decision = CreateAndDecideJob(
254 SyncScheduler::SyncSessionJob::NUDGE); 237 SyncScheduler::SyncSessionJob::NUDGE);
255 238
256 EXPECT_EQ(decision, SyncScheduler::CONTINUE); 239 EXPECT_EQ(decision, SyncScheduler::CONTINUE);
257 } 240 }
(...skipping 18 matching lines...) Expand all
276 struct SyncScheduler::SyncSessionJob job; 259 struct SyncScheduler::SyncSessionJob job;
277 job.purpose = SyncScheduler::SyncSessionJob::CONFIGURATION; 260 job.purpose = SyncScheduler::SyncSessionJob::CONFIGURATION;
278 job.scheduled_start = TimeTicks::Now(); 261 job.scheduled_start = TimeTicks::Now();
279 job.is_canary_job = true; 262 job.is_canary_job = true;
280 SyncScheduler::JobProcessDecision decision = DecideOnJob(job); 263 SyncScheduler::JobProcessDecision decision = DecideOnJob(job);
281 264
282 EXPECT_EQ(decision, SyncScheduler::CONTINUE); 265 EXPECT_EQ(decision, SyncScheduler::CONTINUE);
283 } 266 }
284 267
285 } // namespace browser_sync 268 } // namespace browser_sync
OLDNEW
« no previous file with comments | « sync/engine/sync_scheduler_unittest.cc ('k') | sync/engine/syncer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698