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

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

Issue 11052007: Rename ModelType/ObjectIdStateMap to InvalidationMap. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 2 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_unittest.cc » ('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/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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 136
137 SyncSchedulerImpl::JobProcessDecision decision = 137 SyncSchedulerImpl::JobProcessDecision decision =
138 CreateAndDecideJob(SyncSchedulerImpl::SyncSessionJob::NUDGE); 138 CreateAndDecideJob(SyncSchedulerImpl::SyncSessionJob::NUDGE);
139 139
140 EXPECT_EQ(decision, SyncSchedulerImpl::SAVE); 140 EXPECT_EQ(decision, SyncSchedulerImpl::SAVE);
141 } 141 }
142 142
143 TEST_F(SyncSchedulerWhiteboxTest, SaveNudgeWhileTypeThrottled) { 143 TEST_F(SyncSchedulerWhiteboxTest, SaveNudgeWhileTypeThrottled) {
144 InitializeSyncerOnNormalMode(); 144 InitializeSyncerOnNormalMode();
145 145
146 ModelTypeSet types; 146 const ModelTypeSet types(BOOKMARKS);
147 types.Put(BOOKMARKS);
148 147
149 // Mark bookmarks as throttled. 148 // Mark bookmarks as throttled.
150 context()->throttled_data_type_tracker()->SetUnthrottleTime( 149 context()->throttled_data_type_tracker()->SetUnthrottleTime(
151 types, base::TimeTicks::Now() + base::TimeDelta::FromHours(2)); 150 types, base::TimeTicks::Now() + base::TimeDelta::FromHours(2));
152 151
153 ModelTypeStateMap type_state_map; 152 const ModelTypeInvalidationMap& invalidation_map =
154 type_state_map.insert(std::make_pair(BOOKMARKS, InvalidationState())); 153 ModelTypeSetToInvalidationMap(types, std::string());
155 154
156 SyncSourceInfo info(GetUpdatesCallerInfo::LOCAL, type_state_map); 155 SyncSourceInfo info(GetUpdatesCallerInfo::LOCAL, invalidation_map);
157 SyncSession* s = scheduler_->CreateSyncSession(info); 156 SyncSession* s = scheduler_->CreateSyncSession(info);
158 157
159 // Now schedule a nudge with just bookmarks and the change is local. 158 // Now schedule a nudge with just bookmarks and the change is local.
160 SyncSchedulerImpl::SyncSessionJob job( 159 SyncSchedulerImpl::SyncSessionJob job(
161 SyncSchedulerImpl::SyncSessionJob::NUDGE, 160 SyncSchedulerImpl::SyncSessionJob::NUDGE,
162 TimeTicks::Now(), 161 TimeTicks::Now(),
163 make_linked_ptr(s), 162 make_linked_ptr(s),
164 false, 163 false,
165 ConfigurationParams(), 164 ConfigurationParams(),
166 FROM_HERE); 165 FROM_HERE);
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 struct SyncSchedulerImpl::SyncSessionJob job; 261 struct SyncSchedulerImpl::SyncSessionJob job;
263 job.purpose = SyncSchedulerImpl::SyncSessionJob::CONFIGURATION; 262 job.purpose = SyncSchedulerImpl::SyncSessionJob::CONFIGURATION;
264 job.scheduled_start = TimeTicks::Now(); 263 job.scheduled_start = TimeTicks::Now();
265 job.is_canary_job = true; 264 job.is_canary_job = true;
266 SyncSchedulerImpl::JobProcessDecision decision = DecideOnJob(job); 265 SyncSchedulerImpl::JobProcessDecision decision = DecideOnJob(job);
267 266
268 EXPECT_EQ(decision, SyncSchedulerImpl::CONTINUE); 267 EXPECT_EQ(decision, SyncSchedulerImpl::CONTINUE);
269 } 268 }
270 269
271 } // namespace syncer 270 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/engine/sync_scheduler_unittest.cc ('k') | sync/engine/syncer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698