| 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/sync_scheduler_impl.h" | 8 #include "sync/engine/sync_scheduler_impl.h" |
| 8 #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" |
| 9 #include "sync/sessions/sync_session_context.h" | 11 #include "sync/sessions/sync_session_context.h" |
| 10 #include "sync/sessions/test_util.h" | 12 #include "sync/sessions/test_util.h" |
| 11 #include "sync/test/engine/fake_model_worker.h" | 13 #include "sync/test/engine/fake_model_worker.h" |
| 12 #include "sync/test/engine/mock_connection_manager.h" | 14 #include "sync/test/engine/mock_connection_manager.h" |
| 13 #include "sync/test/engine/test_directory_setter_upper.h" | 15 #include "sync/test/engine/test_directory_setter_upper.h" |
| 14 #include "sync/test/fake_extensions_activity_monitor.h" | 16 #include "sync/test/fake_extensions_activity_monitor.h" |
| 15 #include "testing/gmock/include/gmock/gmock.h" | 17 #include "testing/gmock/include/gmock/gmock.h" |
| 16 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
| 17 | 19 |
| 18 using base::TimeDelta; | 20 using base::TimeDelta; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 48 context_.reset( | 50 context_.reset( |
| 49 new SyncSessionContext( | 51 new SyncSessionContext( |
| 50 connection_.get(), dir_maker_.directory(), | 52 connection_.get(), dir_maker_.directory(), |
| 51 workers, &extensions_activity_monitor_, | 53 workers, &extensions_activity_monitor_, |
| 52 throttled_data_type_tracker_.get(), | 54 throttled_data_type_tracker_.get(), |
| 53 std::vector<SyncEngineEventListener*>(), NULL, NULL, | 55 std::vector<SyncEngineEventListener*>(), NULL, NULL, |
| 54 true /* enable keystore encryption */)); | 56 true /* enable keystore encryption */)); |
| 55 context_->set_notifications_enabled(true); | 57 context_->set_notifications_enabled(true); |
| 56 context_->set_account_name("Test"); | 58 context_->set_account_name("Test"); |
| 57 scheduler_.reset( | 59 scheduler_.reset( |
| 58 new SyncSchedulerImpl("TestSyncSchedulerWhitebox", context(), syncer)); | 60 new SyncSchedulerImpl("TestSyncSchedulerWhitebox", |
| 61 BackoffDelayProvider::FromDefaults(), |
| 62 context(), |
| 63 syncer)); |
| 59 } | 64 } |
| 60 | 65 |
| 61 virtual void TearDown() { | 66 virtual void TearDown() { |
| 62 scheduler_.reset(); | 67 scheduler_.reset(); |
| 63 } | 68 } |
| 64 | 69 |
| 65 void SetMode(SyncScheduler::Mode mode) { | 70 void SetMode(SyncScheduler::Mode mode) { |
| 66 scheduler_->mode_ = mode; | 71 scheduler_->mode_ = mode; |
| 67 } | 72 } |
| 68 | 73 |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 struct SyncSchedulerImpl::SyncSessionJob job; | 267 struct SyncSchedulerImpl::SyncSessionJob job; |
| 263 job.purpose = SyncSchedulerImpl::SyncSessionJob::CONFIGURATION; | 268 job.purpose = SyncSchedulerImpl::SyncSessionJob::CONFIGURATION; |
| 264 job.scheduled_start = TimeTicks::Now(); | 269 job.scheduled_start = TimeTicks::Now(); |
| 265 job.is_canary_job = true; | 270 job.is_canary_job = true; |
| 266 SyncSchedulerImpl::JobProcessDecision decision = DecideOnJob(job); | 271 SyncSchedulerImpl::JobProcessDecision decision = DecideOnJob(job); |
| 267 | 272 |
| 268 EXPECT_EQ(decision, SyncSchedulerImpl::CONTINUE); | 273 EXPECT_EQ(decision, SyncSchedulerImpl::CONTINUE); |
| 269 } | 274 } |
| 270 | 275 |
| 271 } // namespace syncer | 276 } // namespace syncer |
| OLD | NEW |