• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
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 //
16 
17 #ifndef UPDATE_ENGINE_UPDATE_MANAGER_FAKE_SYSTEM_PROVIDER_H_
18 #define UPDATE_ENGINE_UPDATE_MANAGER_FAKE_SYSTEM_PROVIDER_H_
19 
20 #include "update_engine/update_manager/system_provider.h"
21 
22 #include <string>
23 
24 #include "update_engine/update_manager/fake_variable.h"
25 
26 namespace chromeos_update_manager {
27 
28 // Fake implementation of the SystemProvider base class.
29 class FakeSystemProvider : public SystemProvider {
30  public:
FakeSystemProvider()31   FakeSystemProvider() {}
32 
var_is_normal_boot_mode()33   FakeVariable<bool>* var_is_normal_boot_mode() override {
34     return &var_is_normal_boot_mode_;
35   }
36 
var_is_official_build()37   FakeVariable<bool>* var_is_official_build() override {
38     return &var_is_official_build_;
39   }
40 
var_is_oobe_complete()41   FakeVariable<bool>* var_is_oobe_complete() override {
42     return &var_is_oobe_complete_;
43   }
44 
var_num_slots()45   FakeVariable<unsigned int>* var_num_slots() override {
46     return &var_num_slots_;
47   }
48 
var_kiosk_required_platform_version()49   FakeVariable<std::string>* var_kiosk_required_platform_version() override {
50     return &var_kiosk_required_platform_version_;
51   }
52 
53  private:
54   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};
60   FakeVariable<unsigned int> var_num_slots_{"num_slots", kVariableModePoll};
61   FakeVariable<std::string> var_kiosk_required_platform_version_{
62       "kiosk_required_platform_version", kVariableModePoll};
63 
64   DISALLOW_COPY_AND_ASSIGN(FakeSystemProvider);
65 };
66 
67 }  // namespace chromeos_update_manager
68 
69 #endif  // UPDATE_ENGINE_UPDATE_MANAGER_FAKE_SYSTEM_PROVIDER_H_
70