| 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 TEST_F(SyncSchedulerWhiteboxTest, SaveNudgeWhileTypeThrottled) { | 148 TEST_F(SyncSchedulerWhiteboxTest, SaveNudgeWhileTypeThrottled) { |
| 149 InitializeSyncerOnNormalMode(); | 149 InitializeSyncerOnNormalMode(); |
| 150 | 150 |
| 151 ModelTypeSet types; | 151 ModelTypeSet types; |
| 152 types.Put(BOOKMARKS); | 152 types.Put(BOOKMARKS); |
| 153 | 153 |
| 154 // Mark bookmarks as throttled. | 154 // Mark bookmarks as throttled. |
| 155 context()->throttled_data_type_tracker()->SetUnthrottleTime( | 155 context()->throttled_data_type_tracker()->SetUnthrottleTime( |
| 156 types, base::TimeTicks::Now() + base::TimeDelta::FromHours(2)); | 156 types, base::TimeTicks::Now() + base::TimeDelta::FromHours(2)); |
| 157 | 157 |
| 158 ModelTypePayloadMap types_with_payload; | 158 ModelTypeStateMap type_state_map; |
| 159 types_with_payload[BOOKMARKS] = ""; | 159 type_state_map.insert(std::make_pair(BOOKMARKS, InvalidationState())); |
| 160 | 160 |
| 161 SyncSourceInfo info(GetUpdatesCallerInfo::LOCAL, types_with_payload); | 161 SyncSourceInfo info(GetUpdatesCallerInfo::LOCAL, type_state_map); |
| 162 SyncSession* s = scheduler_->CreateSyncSession(info); | 162 SyncSession* s = scheduler_->CreateSyncSession(info); |
| 163 | 163 |
| 164 // Now schedule a nudge with just bookmarks and the change is local. | 164 // Now schedule a nudge with just bookmarks and the change is local. |
| 165 SyncSchedulerImpl::SyncSessionJob job( | 165 SyncSchedulerImpl::SyncSessionJob job( |
| 166 SyncSchedulerImpl::SyncSessionJob::NUDGE, | 166 SyncSchedulerImpl::SyncSessionJob::NUDGE, |
| 167 TimeTicks::Now(), | 167 TimeTicks::Now(), |
| 168 make_linked_ptr(s), | 168 make_linked_ptr(s), |
| 169 false, | 169 false, |
| 170 ConfigurationParams(), | 170 ConfigurationParams(), |
| 171 FROM_HERE); | 171 FROM_HERE); |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 struct SyncSchedulerImpl::SyncSessionJob job; | 267 struct SyncSchedulerImpl::SyncSessionJob job; |
| 268 job.purpose = SyncSchedulerImpl::SyncSessionJob::CONFIGURATION; | 268 job.purpose = SyncSchedulerImpl::SyncSessionJob::CONFIGURATION; |
| 269 job.scheduled_start = TimeTicks::Now(); | 269 job.scheduled_start = TimeTicks::Now(); |
| 270 job.is_canary_job = true; | 270 job.is_canary_job = true; |
| 271 SyncSchedulerImpl::JobProcessDecision decision = DecideOnJob(job); | 271 SyncSchedulerImpl::JobProcessDecision decision = DecideOnJob(job); |
| 272 | 272 |
| 273 EXPECT_EQ(decision, SyncSchedulerImpl::CONTINUE); | 273 EXPECT_EQ(decision, SyncSchedulerImpl::CONTINUE); |
| 274 } | 274 } |
| 275 | 275 |
| 276 } // namespace syncer | 276 } // namespace syncer |
| OLD | NEW |