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

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

Issue 12781007: Merge 185528 "sync: Drop fully datatype throttled sync jobs rath..." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1364/src/
Patch Set: Created 7 years, 9 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_impl.cc ('k') | no next file » | 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/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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 SyncSourceInfo info(GetUpdatesCallerInfo::LOCAL, invalidation_map); 152 SyncSourceInfo info(GetUpdatesCallerInfo::LOCAL, invalidation_map);
153 scoped_ptr<SyncSession> s(scheduler_->CreateSyncSession(info)); 153 scoped_ptr<SyncSession> s(scheduler_->CreateSyncSession(info));
154 154
155 // Now schedule a nudge with just bookmarks and the change is local. 155 // Now schedule a nudge with just bookmarks and the change is local.
156 SyncSessionJob job(SyncSessionJob::NUDGE, 156 SyncSessionJob job(SyncSessionJob::NUDGE,
157 TimeTicks::Now(), 157 TimeTicks::Now(),
158 s.Pass(), 158 s.Pass(),
159 ConfigurationParams(), 159 ConfigurationParams(),
160 FROM_HERE); 160 FROM_HERE);
161 SyncSchedulerImpl::JobProcessDecision decision = DecideOnJob(job); 161 SyncSchedulerImpl::JobProcessDecision decision = DecideOnJob(job);
162 EXPECT_EQ(decision, SyncSchedulerImpl::SAVE); 162 // TODO(tim): This shouldn't drop. Bug 177659.
163 EXPECT_EQ(decision, SyncSchedulerImpl::DROP);
163 } 164 }
164 165
165 TEST_F(SyncSchedulerWhiteboxTest, ContinueNudge) { 166 TEST_F(SyncSchedulerWhiteboxTest, ContinueNudge) {
166 InitializeSyncerOnNormalMode(); 167 InitializeSyncerOnNormalMode();
167 168
168 SyncSchedulerImpl::JobProcessDecision decision = CreateAndDecideJob( 169 SyncSchedulerImpl::JobProcessDecision decision = CreateAndDecideJob(
169 SyncSessionJob::NUDGE); 170 SyncSessionJob::NUDGE);
170 171
171 EXPECT_EQ(decision, SyncSchedulerImpl::CONTINUE); 172 EXPECT_EQ(decision, SyncSchedulerImpl::CONTINUE);
172 } 173 }
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 TimeTicks::Now(), scoped_ptr<SyncSession>(), 257 TimeTicks::Now(), scoped_ptr<SyncSession>(),
257 ConfigurationParams(), FROM_HERE); 258 ConfigurationParams(), FROM_HERE);
258 259
259 job.GrantCanaryPrivilege(); 260 job.GrantCanaryPrivilege();
260 SyncSchedulerImpl::JobProcessDecision decision = DecideOnJob(job); 261 SyncSchedulerImpl::JobProcessDecision decision = DecideOnJob(job);
261 262
262 EXPECT_EQ(decision, SyncSchedulerImpl::CONTINUE); 263 EXPECT_EQ(decision, SyncSchedulerImpl::CONTINUE);
263 } 264 }
264 265
265 } // namespace syncer 266 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/engine/sync_scheduler_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698