Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / sync / test / engine / fake_sync_scheduler.h
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 "base/message_loop/message_loop.h"
13 #include "sync/engine/sync_scheduler.h"
14
15 namespace syncer {
16
17 class FakeSyncScheduler : public SyncScheduler {
18  public:
19   FakeSyncScheduler();
20   ~FakeSyncScheduler() override;
21
22   void Start(Mode mode) 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;
37
38   void OnCredentialsUpdated() override;
39   void OnConnectionStatusChange() override;
40
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;
56 };
57
58 }  // namespace syncer
59
60 #endif  // SYNC_TEST_ENGINE_FAKE_SYNC_SCHEDULER_H_