OLD | NEW |
| (Empty) |
1 // Copyright 2016 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 #ifndef COMPONENTS_OFFLINE_PAGES_BACKGROUND_SCHEDULER_STUB_H_ | |
6 #define COMPONENTS_OFFLINE_PAGES_BACKGROUND_SCHEDULER_STUB_H_ | |
7 | |
8 #include "components/offline_pages/background/scheduler.h" | |
9 | |
10 namespace offline_pages { | |
11 | |
12 // Test class stubbing out the functionality of Scheduler. | |
13 // It is only used for test support. | |
14 class SchedulerStub : public Scheduler { | |
15 public: | |
16 SchedulerStub(); | |
17 ~SchedulerStub() override; | |
18 | |
19 void Schedule(const TriggerConditions& trigger_conditions) override; | |
20 | |
21 void BackupSchedule(const TriggerConditions& trigger_conditions, | |
22 long delay_in_seconds) override; | |
23 | |
24 // Unschedules the currently scheduled task, if any. | |
25 void Unschedule() override; | |
26 | |
27 bool schedule_called() const { return schedule_called_; } | |
28 | |
29 bool backup_schedule_called() const { return backup_schedule_called_; } | |
30 | |
31 bool unschedule_called() const { return unschedule_called_; } | |
32 | |
33 TriggerConditions const* conditions() const { return &conditions_; } | |
34 | |
35 private: | |
36 bool schedule_called_; | |
37 bool backup_schedule_called_; | |
38 bool unschedule_called_; | |
39 long schedule_delay_; | |
40 TriggerConditions conditions_; | |
41 }; | |
42 | |
43 } // namespace offline_pages | |
44 | |
45 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_SCHEDULER_STUB_H_ | |
OLD | NEW |