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