Gilad Arnold | ae47a9a | 2014-03-26 12:16:47 -0700 | [diff] [blame] | 1 | // Copyright (c) 2014 The Chromium OS 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 CHROMEOS_PLATFORM_UPDATE_ENGINE_POLICY_MANAGER_FAKE_UPDATER_PROVIDER_H_ |
| 6 | #define CHROMEOS_PLATFORM_UPDATE_ENGINE_POLICY_MANAGER_FAKE_UPDATER_PROVIDER_H_ |
| 7 | |
Alex Deymo | c7ab616 | 2014-04-25 18:32:50 -0700 | [diff] [blame^] | 8 | #include <string> |
| 9 | |
Gilad Arnold | ae47a9a | 2014-03-26 12:16:47 -0700 | [diff] [blame] | 10 | #include "update_engine/policy_manager/fake_variable.h" |
| 11 | #include "update_engine/policy_manager/updater_provider.h" |
| 12 | |
| 13 | namespace chromeos_policy_manager { |
| 14 | |
| 15 | // Fake implementation of the UpdaterProvider base class. |
| 16 | class FakeUpdaterProvider : public UpdaterProvider { |
| 17 | public: |
| 18 | FakeUpdaterProvider() {} |
| 19 | |
Alex Deymo | c7ab616 | 2014-04-25 18:32:50 -0700 | [diff] [blame^] | 20 | virtual FakeVariable<base::Time>* var_updater_started_time() override { |
| 21 | return &var_updater_started_time_; |
| 22 | } |
| 23 | |
Gilad Arnold | ae47a9a | 2014-03-26 12:16:47 -0700 | [diff] [blame] | 24 | virtual FakeVariable<base::Time>* var_last_checked_time() override { |
| 25 | return &var_last_checked_time_; |
| 26 | } |
| 27 | |
| 28 | virtual FakeVariable<base::Time>* var_update_completed_time() override { |
| 29 | return &var_update_completed_time_; |
| 30 | } |
| 31 | |
| 32 | virtual FakeVariable<double>* var_progress() override { |
| 33 | return &var_progress_; |
| 34 | } |
| 35 | |
| 36 | virtual FakeVariable<Stage>* var_stage() override { |
| 37 | return &var_stage_; |
| 38 | } |
| 39 | |
| 40 | virtual FakeVariable<std::string>* var_new_version() override { |
| 41 | return &var_new_version_; |
| 42 | } |
| 43 | |
| 44 | virtual FakeVariable<size_t>* var_payload_size() override { |
| 45 | return &var_payload_size_; |
| 46 | } |
| 47 | |
| 48 | virtual FakeVariable<std::string>* var_curr_channel() override { |
| 49 | return &var_curr_channel_; |
| 50 | } |
| 51 | |
| 52 | virtual FakeVariable<std::string>* var_new_channel() override { |
| 53 | return &var_new_channel_; |
| 54 | } |
| 55 | |
| 56 | virtual FakeVariable<bool>* var_p2p_enabled() override { |
| 57 | return &var_p2p_enabled_; |
| 58 | } |
| 59 | |
| 60 | virtual FakeVariable<bool>* var_cellular_enabled() override { |
| 61 | return &var_cellular_enabled_; |
| 62 | } |
| 63 | |
David Zeuthen | 21716e2 | 2014-04-23 15:42:05 -0700 | [diff] [blame] | 64 | private: |
Alex Deymo | c7ab616 | 2014-04-25 18:32:50 -0700 | [diff] [blame^] | 65 | FakeVariable<base::Time> var_updater_started_time_{ |
| 66 | "updater_started_time", kVariableModePoll}; |
Gilad Arnold | ae47a9a | 2014-03-26 12:16:47 -0700 | [diff] [blame] | 67 | FakeVariable<base::Time> var_last_checked_time_{ |
| 68 | "last_checked_time", kVariableModePoll}; |
| 69 | FakeVariable<base::Time> var_update_completed_time_{ |
| 70 | "update_completed_time", kVariableModePoll}; |
| 71 | FakeVariable<double> var_progress_{"progress", kVariableModePoll}; |
| 72 | FakeVariable<Stage> var_stage_{"stage", kVariableModePoll}; |
| 73 | FakeVariable<std::string> var_new_version_{"new_version", kVariableModePoll}; |
| 74 | FakeVariable<size_t> var_payload_size_{"payload_size", kVariableModePoll}; |
| 75 | FakeVariable<std::string> var_curr_channel_{ |
| 76 | "curr_channel", kVariableModePoll}; |
| 77 | FakeVariable<std::string> var_new_channel_{"new_channel", kVariableModePoll}; |
| 78 | FakeVariable<bool> var_p2p_enabled_{"p2p_enabled", kVariableModePoll}; |
| 79 | FakeVariable<bool> var_cellular_enabled_{ |
| 80 | "cellular_enabled", kVariableModePoll}; |
| 81 | |
| 82 | DISALLOW_COPY_AND_ASSIGN(FakeUpdaterProvider); |
| 83 | }; |
| 84 | |
| 85 | } // namespace chromeos_policy_manager |
| 86 | |
| 87 | #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_POLICY_MANAGER_FAKE_UPDATER_PROVIDER_H_ |