blob: f54951b3cf5496ff1bcd020e9306e9b98f538d99 [file] [log] [blame]
Alex Deymoaea4c1c2015-08-19 20:24:43 -07001//
2// Copyright (C) 2014 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15//
Alex Deymobd04b142014-03-18 15:00:05 -070016
Gilad Arnold48415f12014-06-27 07:10:58 -070017#ifndef UPDATE_ENGINE_UPDATE_MANAGER_FAKE_SYSTEM_PROVIDER_H_
18#define UPDATE_ENGINE_UPDATE_MANAGER_FAKE_SYSTEM_PROVIDER_H_
Alex Deymobd04b142014-03-18 15:00:05 -070019
Alex Deymo63784a52014-05-28 10:46:14 -070020#include "update_engine/update_manager/system_provider.h"
Alex Deymobd04b142014-03-18 15:00:05 -070021
Amin Hassani4b717432019-01-14 16:24:20 -080022#include <string>
23
24#include "update_engine/update_manager/fake_variable.h"
25
Alex Deymo63784a52014-05-28 10:46:14 -070026namespace chromeos_update_manager {
Alex Deymobd04b142014-03-18 15:00:05 -070027
28// Fake implementation of the SystemProvider base class.
29class FakeSystemProvider : public SystemProvider {
30 public:
31 FakeSystemProvider() {}
32
Alex Vakulenko157fe302014-08-11 15:59:58 -070033 FakeVariable<bool>* var_is_normal_boot_mode() override {
David Zeuthen21716e22014-04-23 15:42:05 -070034 return &var_is_normal_boot_mode_;
35 }
36
Alex Vakulenko157fe302014-08-11 15:59:58 -070037 FakeVariable<bool>* var_is_official_build() override {
David Zeuthen21716e22014-04-23 15:42:05 -070038 return &var_is_official_build_;
Alex Deymobd04b142014-03-18 15:00:05 -070039 }
40
Alex Vakulenko157fe302014-08-11 15:59:58 -070041 FakeVariable<bool>* var_is_oobe_complete() override {
Gilad Arnold48e13612014-05-16 10:18:05 -070042 return &var_is_oobe_complete_;
43 }
44
Alex Deymo763e7db2015-08-27 21:08:08 -070045 FakeVariable<unsigned int>* var_num_slots() override {
46 return &var_num_slots_;
Gilad Arnoldbfc44f72014-07-09 14:41:39 -070047 }
48
Xiyuan Xia6e30bc52016-02-24 15:35:42 -080049 FakeVariable<std::string>* var_kiosk_required_platform_version() override {
50 return &var_kiosk_required_platform_version_;
51 }
52
Alex Deymobd04b142014-03-18 15:00:05 -070053 private:
Amin Hassani4b717432019-01-14 16:24:20 -080054 FakeVariable<bool> var_is_normal_boot_mode_{"is_normal_boot_mode",
55 kVariableModeConst};
56 FakeVariable<bool> var_is_official_build_{"is_official_build",
57 kVariableModeConst};
58 FakeVariable<bool> var_is_oobe_complete_{"is_oobe_complete",
59 kVariableModePoll};
Alex Deymo763e7db2015-08-27 21:08:08 -070060 FakeVariable<unsigned int> var_num_slots_{"num_slots", kVariableModePoll};
Xiyuan Xia6e30bc52016-02-24 15:35:42 -080061 FakeVariable<std::string> var_kiosk_required_platform_version_{
62 "kiosk_required_platform_version", kVariableModePoll};
David Zeuthen21716e22014-04-23 15:42:05 -070063
Alex Deymobd04b142014-03-18 15:00:05 -070064 DISALLOW_COPY_AND_ASSIGN(FakeSystemProvider);
65};
66
Alex Deymo63784a52014-05-28 10:46:14 -070067} // namespace chromeos_update_manager
Alex Deymobd04b142014-03-18 15:00:05 -070068
Gilad Arnold48415f12014-06-27 07:10:58 -070069#endif // UPDATE_ENGINE_UPDATE_MANAGER_FAKE_SYSTEM_PROVIDER_H_