Alex Deymo | 2de23f5 | 2014-02-26 14:30:13 -0800 | [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 | |
Gilad Arnold | 2cbb385 | 2014-03-07 12:40:50 -0800 | [diff] [blame] | 5 | #ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_POLICY_MANAGER_FAKE_SHILL_PROVIDER_H_ |
| 6 | #define CHROMEOS_PLATFORM_UPDATE_ENGINE_POLICY_MANAGER_FAKE_SHILL_PROVIDER_H_ |
Alex Deymo | 2de23f5 | 2014-02-26 14:30:13 -0800 | [diff] [blame] | 7 | |
| 8 | #include "update_engine/policy_manager/fake_variable.h" |
| 9 | #include "update_engine/policy_manager/shill_provider.h" |
| 10 | |
| 11 | namespace chromeos_policy_manager { |
| 12 | |
| 13 | // Fake implementation of the ShillProvider base class. |
| 14 | class FakeShillProvider : public ShillProvider { |
| 15 | public: |
| 16 | FakeShillProvider() {} |
| 17 | |
Gilad Arnold | df3dd24 | 2014-04-09 07:15:51 -0700 | [diff] [blame^] | 18 | virtual inline FakeVariable<bool>* var_is_connected() override { |
| 19 | return &var_is_connected_; |
Alex Deymo | 2de23f5 | 2014-02-26 14:30:13 -0800 | [diff] [blame] | 20 | } |
| 21 | |
Gilad Arnold | df3dd24 | 2014-04-09 07:15:51 -0700 | [diff] [blame^] | 22 | virtual inline FakeVariable<ConnectionType>* var_conn_type() override { |
| 23 | return &var_conn_type_; |
| 24 | } |
| 25 | |
| 26 | virtual inline FakeVariable<base::Time>* var_conn_last_changed() override { |
| 27 | return &var_conn_last_changed_; |
| 28 | } |
| 29 | |
| 30 | protected: |
| 31 | virtual bool DoInit() { return true; } |
| 32 | |
Alex Deymo | 2de23f5 | 2014-02-26 14:30:13 -0800 | [diff] [blame] | 33 | private: |
Gilad Arnold | df3dd24 | 2014-04-09 07:15:51 -0700 | [diff] [blame^] | 34 | FakeVariable<bool> var_is_connected_{"is_connected", kVariableModePoll}; |
| 35 | FakeVariable<ConnectionType> var_conn_type_{"conn_type", kVariableModePoll}; |
| 36 | FakeVariable<base::Time> var_conn_last_changed_{"conn_last_changed", |
| 37 | kVariableModePoll}; |
| 38 | |
Alex Deymo | 2de23f5 | 2014-02-26 14:30:13 -0800 | [diff] [blame] | 39 | DISALLOW_COPY_AND_ASSIGN(FakeShillProvider); |
| 40 | }; |
| 41 | |
| 42 | } // namespace chromeos_policy_manager |
| 43 | |
Gilad Arnold | 2cbb385 | 2014-03-07 12:40:50 -0800 | [diff] [blame] | 44 | #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_POLICY_MANAGER_FAKE_SHILL_PROVIDER_H_ |