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/message_loop.h" | 12 #include "base/message_loop/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 ~FakeSyncScheduler() override; |
21 | 21 |
22 virtual void Start(Mode mode) override; | 22 void Start(Mode mode) override; |
23 virtual void Stop() override; | 23 void Stop() override; |
24 virtual void ScheduleLocalNudge( | 24 void ScheduleLocalNudge( |
25 ModelTypeSet types, | 25 ModelTypeSet types, |
26 const tracked_objects::Location& nudge_location) override; | 26 const tracked_objects::Location& nudge_location) override; |
27 virtual void ScheduleLocalRefreshRequest( | 27 void ScheduleLocalRefreshRequest( |
28 ModelTypeSet types, | 28 ModelTypeSet types, |
29 const tracked_objects::Location& nudge_location) override; | 29 const tracked_objects::Location& nudge_location) override; |
30 virtual void ScheduleInvalidationNudge( | 30 void ScheduleInvalidationNudge( |
31 syncer::ModelType type, | 31 syncer::ModelType type, |
32 scoped_ptr<InvalidationInterface> interface, | 32 scoped_ptr<InvalidationInterface> interface, |
33 const tracked_objects::Location& nudge_location) override; | 33 const tracked_objects::Location& nudge_location) override; |
34 virtual void ScheduleConfiguration( | 34 void ScheduleConfiguration(const ConfigurationParams& params) override; |
35 const ConfigurationParams& params) override; | 35 void ScheduleInitialSyncNudge(syncer::ModelType model_type) override; |
36 virtual void ScheduleInitialSyncNudge(syncer::ModelType model_type) override; | 36 void SetNotificationsEnabled(bool notifications_enabled) override; |
37 virtual void SetNotificationsEnabled(bool notifications_enabled) override; | |
38 | 37 |
39 virtual void OnCredentialsUpdated() override; | 38 void OnCredentialsUpdated() override; |
40 virtual void OnConnectionStatusChange() override; | 39 void OnConnectionStatusChange() override; |
41 | 40 |
42 // SyncSession::Delegate implementation. | 41 // SyncSession::Delegate implementation. |
43 virtual void OnThrottled( | 42 void OnThrottled(const base::TimeDelta& throttle_duration) override; |
44 const base::TimeDelta& throttle_duration) override; | 43 void OnTypesThrottled(ModelTypeSet types, |
45 virtual void OnTypesThrottled( | 44 const base::TimeDelta& throttle_duration) override; |
46 ModelTypeSet types, | 45 bool IsCurrentlyThrottled() override; |
47 const base::TimeDelta& throttle_duration) override; | 46 void OnReceivedShortPollIntervalUpdate( |
48 virtual bool IsCurrentlyThrottled() override; | |
49 virtual void OnReceivedShortPollIntervalUpdate( | |
50 const base::TimeDelta& new_interval) override; | 47 const base::TimeDelta& new_interval) override; |
51 virtual void OnReceivedLongPollIntervalUpdate( | 48 void OnReceivedLongPollIntervalUpdate( |
52 const base::TimeDelta& new_interval) override; | 49 const base::TimeDelta& new_interval) override; |
53 virtual void OnReceivedCustomNudgeDelays( | 50 void OnReceivedCustomNudgeDelays( |
54 const std::map<ModelType, base::TimeDelta>& nudge_delays) override; | 51 const std::map<ModelType, base::TimeDelta>& nudge_delays) override; |
55 virtual void OnReceivedClientInvalidationHintBufferSize(int size) override; | 52 void OnReceivedClientInvalidationHintBufferSize(int size) override; |
56 virtual void OnSyncProtocolError( | 53 void OnSyncProtocolError(const SyncProtocolError& error) override; |
57 const SyncProtocolError& error) override; | 54 void OnReceivedGuRetryDelay(const base::TimeDelta& delay) override; |
58 virtual void OnReceivedGuRetryDelay( | 55 void OnReceivedMigrationRequest(ModelTypeSet types) override; |
59 const base::TimeDelta& delay) override; | |
60 virtual void OnReceivedMigrationRequest(ModelTypeSet types) override; | |
61 }; | 56 }; |
62 | 57 |
63 } // namespace syncer | 58 } // namespace syncer |
64 | 59 |
65 #endif // SYNC_TEST_ENGINE_FAKE_SYNC_SCHEDULER_H_ | 60 #endif // SYNC_TEST_ENGINE_FAKE_SYNC_SCHEDULER_H_ |
OLD | NEW |