Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(695)

Side by Side Diff: components/offline_pages/core/background/scheduler_stub.h

Issue 2659813006: Always get device conditions from Java for every attempt. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_OFFLINE_PAGES_CORE_BACKGROUND_SCHEDULER_STUB_H_ 5 #ifndef COMPONENTS_OFFLINE_PAGES_CORE_BACKGROUND_SCHEDULER_STUB_H_
6 #define COMPONENTS_OFFLINE_PAGES_CORE_BACKGROUND_SCHEDULER_STUB_H_ 6 #define COMPONENTS_OFFLINE_PAGES_CORE_BACKGROUND_SCHEDULER_STUB_H_
7 7
8 #include "components/offline_pages/core/background/scheduler.h" 8 #include "components/offline_pages/core/background/scheduler.h"
9 9
10 namespace offline_pages { 10 namespace offline_pages {
11 11
12 // Test class stubbing out the functionality of Scheduler. 12 // Test class stubbing out the functionality of Scheduler.
13 // It is only used for test support. 13 // It is only used for test support.
14 class SchedulerStub : public Scheduler { 14 class SchedulerStub : public Scheduler {
15 public: 15 public:
16 SchedulerStub(); 16 SchedulerStub();
17 ~SchedulerStub() override; 17 ~SchedulerStub() override;
18 18
19 void Schedule(const TriggerConditions& trigger_conditions) override; 19 void Schedule(const TriggerConditions& trigger_conditions) override;
20 20
21 void BackupSchedule(const TriggerConditions& trigger_conditions, 21 void BackupSchedule(const TriggerConditions& trigger_conditions,
22 long delay_in_seconds) override; 22 long delay_in_seconds) override;
23 23
24 // Unschedules the currently scheduled task, if any. 24 // Unschedules the currently scheduled task, if any.
25 void Unschedule() override; 25 void Unschedule() override;
26 26
27 // Get the current device conditions from the android APIs
dougarnett 2017/01/27 23:15:56 nit - period
Pete Williamson 2017/01/28 00:24:46 Done.
28 DeviceConditions& GetCurrentDeviceConditions() override;
29
27 bool schedule_called() const { return schedule_called_; } 30 bool schedule_called() const { return schedule_called_; }
28 31
29 bool backup_schedule_called() const { return backup_schedule_called_; } 32 bool backup_schedule_called() const { return backup_schedule_called_; }
30 33
31 bool unschedule_called() const { return unschedule_called_; } 34 bool unschedule_called() const { return unschedule_called_; }
32 35
33 TriggerConditions const* conditions() const { return &conditions_; } 36 TriggerConditions const* trigger_conditions() const {
37 return &trigger_conditions_;
38 }
34 39
35 private: 40 private:
36 bool schedule_called_; 41 bool schedule_called_;
37 bool backup_schedule_called_; 42 bool backup_schedule_called_;
38 bool unschedule_called_; 43 bool unschedule_called_;
44 bool get_current_device_conditions_called_;
39 long schedule_delay_; 45 long schedule_delay_;
40 TriggerConditions conditions_; 46 DeviceConditions device_conditions_;
47 TriggerConditions trigger_conditions_;
41 }; 48 };
42 49
43 } // namespace offline_pages 50 } // namespace offline_pages
44 51
45 #endif // COMPONENTS_OFFLINE_PAGES_CORE_BACKGROUND_SCHEDULER_STUB_H_ 52 #endif // COMPONENTS_OFFLINE_PAGES_CORE_BACKGROUND_SCHEDULER_STUB_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698