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

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

Issue 10837214: Refactor ModelTypePayloadMap and ObjectIdPayloadMap to StateMaps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . 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/sync_scheduler_impl.h" 7 #include "sync/engine/sync_scheduler_impl.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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 TEST_F(SyncSchedulerWhiteboxTest, SaveNudgeWhileTypeThrottled) { 143 TEST_F(SyncSchedulerWhiteboxTest, SaveNudgeWhileTypeThrottled) {
144 InitializeSyncerOnNormalMode(); 144 InitializeSyncerOnNormalMode();
145 145
146 ModelTypeSet types; 146 ModelTypeSet types;
147 types.Put(BOOKMARKS); 147 types.Put(BOOKMARKS);
148 148
149 // Mark bookmarks as throttled. 149 // Mark bookmarks as throttled.
150 context()->throttled_data_type_tracker()->SetUnthrottleTime( 150 context()->throttled_data_type_tracker()->SetUnthrottleTime(
151 types, base::TimeTicks::Now() + base::TimeDelta::FromHours(2)); 151 types, base::TimeTicks::Now() + base::TimeDelta::FromHours(2));
152 152
153 ModelTypePayloadMap types_with_payload; 153 ModelTypeStateMap type_state_map;
154 types_with_payload[BOOKMARKS] = ""; 154 type_state_map.insert(std::make_pair(BOOKMARKS, InvalidationState()));
155 155
156 SyncSourceInfo info(GetUpdatesCallerInfo::LOCAL, types_with_payload); 156 SyncSourceInfo info(GetUpdatesCallerInfo::LOCAL, type_state_map);
157 SyncSession* s = scheduler_->CreateSyncSession(info); 157 SyncSession* s = scheduler_->CreateSyncSession(info);
158 158
159 // Now schedule a nudge with just bookmarks and the change is local. 159 // Now schedule a nudge with just bookmarks and the change is local.
160 SyncSchedulerImpl::SyncSessionJob job( 160 SyncSchedulerImpl::SyncSessionJob job(
161 SyncSchedulerImpl::SyncSessionJob::NUDGE, 161 SyncSchedulerImpl::SyncSessionJob::NUDGE,
162 TimeTicks::Now(), 162 TimeTicks::Now(),
163 make_linked_ptr(s), 163 make_linked_ptr(s),
164 false, 164 false,
165 ConfigurationParams(), 165 ConfigurationParams(),
166 FROM_HERE); 166 FROM_HERE);
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 struct SyncSchedulerImpl::SyncSessionJob job; 262 struct SyncSchedulerImpl::SyncSessionJob job;
263 job.purpose = SyncSchedulerImpl::SyncSessionJob::CONFIGURATION; 263 job.purpose = SyncSchedulerImpl::SyncSessionJob::CONFIGURATION;
264 job.scheduled_start = TimeTicks::Now(); 264 job.scheduled_start = TimeTicks::Now();
265 job.is_canary_job = true; 265 job.is_canary_job = true;
266 SyncSchedulerImpl::JobProcessDecision decision = DecideOnJob(job); 266 SyncSchedulerImpl::JobProcessDecision decision = DecideOnJob(job);
267 267
268 EXPECT_EQ(decision, SyncSchedulerImpl::CONTINUE); 268 EXPECT_EQ(decision, SyncSchedulerImpl::CONTINUE);
269 } 269 }
270 270
271 } // namespace syncer 271 } // namespace syncer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698