| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 // | |
| 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 | |
| 7 // level test classes. | |
| 8 | |
| 9 #ifndef SYNC_TEST_ENGINE_FAKE_SYNC_SCHEDULER_H_ | |
| 10 #define SYNC_TEST_ENGINE_FAKE_SYNC_SCHEDULER_H_ | |
| 11 | |
| 12 #include <map> | |
| 13 | |
| 14 #include "base/message_loop/message_loop.h" | |
| 15 #include "sync/engine/sync_scheduler.h" | |
| 16 | |
| 17 namespace syncer { | |
| 18 | |
| 19 class FakeSyncScheduler : public SyncScheduler { | |
| 20 public: | |
| 21 FakeSyncScheduler(); | |
| 22 ~FakeSyncScheduler() override; | |
| 23 | |
| 24 void Start(Mode mode, base::Time last_poll_time) override; | |
| 25 void Stop() override; | |
| 26 void ScheduleLocalNudge( | |
| 27 ModelTypeSet types, | |
| 28 const tracked_objects::Location& nudge_location) override; | |
| 29 void ScheduleLocalRefreshRequest( | |
| 30 ModelTypeSet types, | |
| 31 const tracked_objects::Location& nudge_location) override; | |
| 32 void ScheduleInvalidationNudge( | |
| 33 syncer::ModelType type, | |
| 34 std::unique_ptr<InvalidationInterface> interface, | |
| 35 const tracked_objects::Location& nudge_location) override; | |
| 36 void ScheduleConfiguration(const ConfigurationParams& params) override; | |
| 37 void ScheduleClearServerData(const ClearParams& params) override; | |
| 38 | |
| 39 void ScheduleInitialSyncNudge(syncer::ModelType model_type) override; | |
| 40 void SetNotificationsEnabled(bool notifications_enabled) override; | |
| 41 | |
| 42 void OnCredentialsUpdated() override; | |
| 43 void OnConnectionStatusChange() override; | |
| 44 | |
| 45 // SyncSession::Delegate implementation. | |
| 46 void OnThrottled(const base::TimeDelta& throttle_duration) override; | |
| 47 void OnTypesThrottled(ModelTypeSet types, | |
| 48 const base::TimeDelta& throttle_duration) override; | |
| 49 bool IsCurrentlyThrottled() override; | |
| 50 void OnReceivedShortPollIntervalUpdate( | |
| 51 const base::TimeDelta& new_interval) override; | |
| 52 void OnReceivedLongPollIntervalUpdate( | |
| 53 const base::TimeDelta& new_interval) override; | |
| 54 void OnReceivedCustomNudgeDelays( | |
| 55 const std::map<ModelType, base::TimeDelta>& nudge_delays) override; | |
| 56 void OnReceivedClientInvalidationHintBufferSize(int size) override; | |
| 57 void OnSyncProtocolError(const SyncProtocolError& error) override; | |
| 58 void OnReceivedGuRetryDelay(const base::TimeDelta& delay) override; | |
| 59 void OnReceivedMigrationRequest(ModelTypeSet types) override; | |
| 60 }; | |
| 61 | |
| 62 } // namespace syncer | |
| 63 | |
| 64 #endif // SYNC_TEST_ENGINE_FAKE_SYNC_SCHEDULER_H_ | |
| OLD | NEW |