Reland [Sync] Refactoring polling to be reliable.
[chromium-blink-merge.git] / sync / test / engine / fake_sync_scheduler.h
blob475a9eb57b01a2f87a0f7974b882f33d0dfb0b9f
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.
9 #ifndef SYNC_TEST_ENGINE_FAKE_SYNC_SCHEDULER_H_
10 #define SYNC_TEST_ENGINE_FAKE_SYNC_SCHEDULER_H_
12 #include "base/message_loop/message_loop.h"
13 #include "sync/engine/sync_scheduler.h"
15 namespace syncer {
17 class FakeSyncScheduler : public SyncScheduler {
18 public:
19 FakeSyncScheduler();
20 ~FakeSyncScheduler() override;
22 void Start(Mode mode, base::Time last_poll_time) override;
23 void Stop() override;
24 void ScheduleLocalNudge(
25 ModelTypeSet types,
26 const tracked_objects::Location& nudge_location) override;
27 void ScheduleLocalRefreshRequest(
28 ModelTypeSet types,
29 const tracked_objects::Location& nudge_location) override;
30 void ScheduleInvalidationNudge(
31 syncer::ModelType type,
32 scoped_ptr<InvalidationInterface> interface,
33 const tracked_objects::Location& nudge_location) override;
34 void ScheduleConfiguration(const ConfigurationParams& params) override;
35 void ScheduleInitialSyncNudge(syncer::ModelType model_type) override;
36 void SetNotificationsEnabled(bool notifications_enabled) override;
38 void OnCredentialsUpdated() override;
39 void OnConnectionStatusChange() override;
41 // SyncSession::Delegate implementation.
42 void OnThrottled(const base::TimeDelta& throttle_duration) override;
43 void OnTypesThrottled(ModelTypeSet types,
44 const base::TimeDelta& throttle_duration) override;
45 bool IsCurrentlyThrottled() override;
46 void OnReceivedShortPollIntervalUpdate(
47 const base::TimeDelta& new_interval) override;
48 void OnReceivedLongPollIntervalUpdate(
49 const base::TimeDelta& new_interval) override;
50 void OnReceivedCustomNudgeDelays(
51 const std::map<ModelType, base::TimeDelta>& nudge_delays) override;
52 void OnReceivedClientInvalidationHintBufferSize(int size) override;
53 void OnSyncProtocolError(const SyncProtocolError& error) override;
54 void OnReceivedGuRetryDelay(const base::TimeDelta& delay) override;
55 void OnReceivedMigrationRequest(ModelTypeSet types) override;
58 } // namespace syncer
60 #endif // SYNC_TEST_ENGINE_FAKE_SYNC_SCHEDULER_H_