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 ScheduleClearServerData(const ClearParams
& params
) override
;
37 void ScheduleInitialSyncNudge(syncer::ModelType model_type
) override
;
38 void SetNotificationsEnabled(bool notifications_enabled
) override
;
40 void OnCredentialsUpdated() override
;
41 void OnConnectionStatusChange() override
;
43 // SyncSession::Delegate implementation.
44 void OnThrottled(const base::TimeDelta
& throttle_duration
) override
;
45 void OnTypesThrottled(ModelTypeSet types
,
46 const base::TimeDelta
& throttle_duration
) override
;
47 bool IsCurrentlyThrottled() override
;
48 void OnReceivedShortPollIntervalUpdate(
49 const base::TimeDelta
& new_interval
) override
;
50 void OnReceivedLongPollIntervalUpdate(
51 const base::TimeDelta
& new_interval
) override
;
52 void OnReceivedCustomNudgeDelays(
53 const std::map
<ModelType
, base::TimeDelta
>& nudge_delays
) override
;
54 void OnReceivedClientInvalidationHintBufferSize(int size
) override
;
55 void OnSyncProtocolError(const SyncProtocolError
& error
) override
;
56 void OnReceivedGuRetryDelay(const base::TimeDelta
& delay
) override
;
57 void OnReceivedMigrationRequest(ModelTypeSet types
) override
;
62 #endif // SYNC_TEST_ENGINE_FAKE_SYNC_SCHEDULER_H_