| 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 // A fake implementation of the SyncScheduler. If needed, we should add default | 5 // A fake implementation of the SyncScheduler. If needed, we should add default |
| 6 // logic needed for tests (invoking callbacks, etc) here rather than in higher | 6 // logic needed for tests (invoking callbacks, etc) here rather than in higher |
| 7 // level test classes. | 7 // level test classes. |
| 8 | 8 |
| 9 #ifndef SYNC_TEST_ENGINE_FAKE_SYNC_SCHEDULER_H_ | 9 #ifndef SYNC_TEST_ENGINE_FAKE_SYNC_SCHEDULER_H_ |
| 10 #define SYNC_TEST_ENGINE_FAKE_SYNC_SCHEDULER_H_ | 10 #define SYNC_TEST_ENGINE_FAKE_SYNC_SCHEDULER_H_ |
| 11 | 11 |
| 12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
| 13 #include "sync/engine/sync_scheduler.h" | 13 #include "sync/engine/sync_scheduler.h" |
| 14 | 14 |
| 15 namespace syncer { | 15 namespace syncer { |
| 16 | 16 |
| 17 class FakeSyncScheduler : public SyncScheduler { | 17 class FakeSyncScheduler : public SyncScheduler { |
| 18 public: | 18 public: |
| 19 FakeSyncScheduler(); | 19 FakeSyncScheduler(); |
| 20 virtual ~FakeSyncScheduler(); | 20 virtual ~FakeSyncScheduler(); |
| 21 | 21 |
| 22 virtual void Start(Mode mode) OVERRIDE; | 22 virtual void Start(Mode mode) OVERRIDE; |
| 23 virtual void RequestStop(const base::Closure& callback) OVERRIDE; | 23 virtual void RequestStop(const base::Closure& callback) OVERRIDE; |
| 24 virtual void ScheduleNudgeAsync( | 24 virtual void ScheduleLocalNudge( |
| 25 const base::TimeDelta& delay, | 25 const base::TimeDelta& desired_delay, |
| 26 NudgeSource source, | |
| 27 ModelTypeSet types, | 26 ModelTypeSet types, |
| 28 const tracked_objects::Location& nudge_location) OVERRIDE; | 27 const tracked_objects::Location& nudge_location) OVERRIDE; |
| 29 virtual void ScheduleNudgeWithStatesAsync( | 28 virtual void ScheduleLocalRefreshRequest( |
| 30 const base::TimeDelta& delay, NudgeSource source, | 29 const base::TimeDelta& desired_delay, |
| 30 ModelTypeSet types, |
| 31 const tracked_objects::Location& nudge_location) OVERRIDE; |
| 32 virtual void ScheduleInvalidationNudge( |
| 33 const base::TimeDelta& desired_delay, |
| 31 const ModelTypeInvalidationMap& invalidation_map, | 34 const ModelTypeInvalidationMap& invalidation_map, |
| 32 const tracked_objects::Location& nudge_location) OVERRIDE; | 35 const tracked_objects::Location& nudge_location) OVERRIDE; |
| 33 virtual bool ScheduleConfiguration( | 36 virtual bool ScheduleConfiguration( |
| 34 const ConfigurationParams& params) OVERRIDE; | 37 const ConfigurationParams& params) OVERRIDE; |
| 35 virtual void SetNotificationsEnabled(bool notifications_enabled) OVERRIDE; | 38 virtual void SetNotificationsEnabled(bool notifications_enabled) OVERRIDE; |
| 36 | 39 |
| 37 virtual base::TimeDelta GetSessionsCommitDelay() const OVERRIDE; | 40 virtual base::TimeDelta GetSessionsCommitDelay() const OVERRIDE; |
| 38 virtual void OnCredentialsUpdated() OVERRIDE; | 41 virtual void OnCredentialsUpdated() OVERRIDE; |
| 39 virtual void OnConnectionStatusChange() OVERRIDE; | 42 virtual void OnConnectionStatusChange() OVERRIDE; |
| 40 | 43 |
| 41 // SyncSession::Delegate implementation. | 44 // SyncSession::Delegate implementation. |
| 42 virtual void OnSilencedUntil( | 45 virtual void OnSilencedUntil( |
| 43 const base::TimeTicks& silenced_until) OVERRIDE; | 46 const base::TimeTicks& silenced_until) OVERRIDE; |
| 44 virtual bool IsSyncingCurrentlySilenced() OVERRIDE; | 47 virtual bool IsSyncingCurrentlySilenced() OVERRIDE; |
| 45 virtual void OnReceivedShortPollIntervalUpdate( | 48 virtual void OnReceivedShortPollIntervalUpdate( |
| 46 const base::TimeDelta& new_interval) OVERRIDE; | 49 const base::TimeDelta& new_interval) OVERRIDE; |
| 47 virtual void OnReceivedLongPollIntervalUpdate( | 50 virtual void OnReceivedLongPollIntervalUpdate( |
| 48 const base::TimeDelta& new_interval) OVERRIDE; | 51 const base::TimeDelta& new_interval) OVERRIDE; |
| 49 virtual void OnReceivedSessionsCommitDelay( | 52 virtual void OnReceivedSessionsCommitDelay( |
| 50 const base::TimeDelta& new_delay) OVERRIDE; | 53 const base::TimeDelta& new_delay) OVERRIDE; |
| 54 virtual void OnReceivedClientInvalidationHintBufferSize(int size) OVERRIDE; |
| 51 virtual void OnShouldStopSyncingPermanently() OVERRIDE; | 55 virtual void OnShouldStopSyncingPermanently() OVERRIDE; |
| 52 virtual void OnSyncProtocolError( | 56 virtual void OnSyncProtocolError( |
| 53 const sessions::SyncSessionSnapshot& snapshot) OVERRIDE; | 57 const sessions::SyncSessionSnapshot& snapshot) OVERRIDE; |
| 54 | 58 |
| 55 private: | 59 private: |
| 56 base::MessageLoop* const created_on_loop_; | 60 base::MessageLoop* const created_on_loop_; |
| 57 }; | 61 }; |
| 58 | 62 |
| 59 } // namespace syncer | 63 } // namespace syncer |
| 60 | 64 |
| 61 #endif // SYNC_TEST_ENGINE_FAKE_SYNC_SCHEDULER_H_ | 65 #endif // SYNC_TEST_ENGINE_FAKE_SYNC_SCHEDULER_H_ |
| OLD | NEW |