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 | |
Gilad Arnold | ef120fa | 2014-04-09 12:52:10 -0700 | [diff] [blame^] | 26 | virtual inline FakeVariable<ConnectionTethering>* |
| 27 | var_conn_tethering() override { |
| 28 | return &var_conn_tethering_; |
| 29 | } |
| 30 | |
Gilad Arnold | df3dd24 | 2014-04-09 07:15:51 -0700 | [diff] [blame] | 31 | virtual inline FakeVariable<base::Time>* var_conn_last_changed() override { |
| 32 | return &var_conn_last_changed_; |
| 33 | } |
| 34 | |
| 35 | protected: |
| 36 | virtual bool DoInit() { return true; } |
| 37 | |
Alex Deymo | 2de23f5 | 2014-02-26 14:30:13 -0800 | [diff] [blame] | 38 | private: |
Gilad Arnold | df3dd24 | 2014-04-09 07:15:51 -0700 | [diff] [blame] | 39 | FakeVariable<bool> var_is_connected_{"is_connected", kVariableModePoll}; |
| 40 | FakeVariable<ConnectionType> var_conn_type_{"conn_type", kVariableModePoll}; |
Gilad Arnold | ef120fa | 2014-04-09 12:52:10 -0700 | [diff] [blame^] | 41 | FakeVariable<ConnectionTethering> var_conn_tethering_{ |
| 42 | "conn_tethering", kVariableModePoll}; |
| 43 | FakeVariable<base::Time> var_conn_last_changed_{ |
| 44 | "conn_last_changed", kVariableModePoll}; |
Gilad Arnold | df3dd24 | 2014-04-09 07:15:51 -0700 | [diff] [blame] | 45 | |
Alex Deymo | 2de23f5 | 2014-02-26 14:30:13 -0800 | [diff] [blame] | 46 | DISALLOW_COPY_AND_ASSIGN(FakeShillProvider); |
| 47 | }; |
| 48 | |
| 49 | } // namespace chromeos_policy_manager |
| 50 | |
Gilad Arnold | 2cbb385 | 2014-03-07 12:40:50 -0800 | [diff] [blame] | 51 | #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_POLICY_MANAGER_FAKE_SHILL_PROVIDER_H_ |