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.
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
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"
17 class FakeSyncScheduler
: public SyncScheduler
{
20 ~FakeSyncScheduler() override
;
22 void Start(Mode mode
, base::Time last_poll_time
) override
;
24 void ScheduleLocalNudge(
26 const tracked_objects::Location
& nudge_location
) override
;
27 void ScheduleLocalRefreshRequest(
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
;
60 #endif // SYNC_TEST_ENGINE_FAKE_SYNC_SCHEDULER_H_