| 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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |