Jay Srinivasan | 08fce04 | 2012-06-07 16:31:01 -0700 | [diff] [blame] | 1 | // Copyright (c) 2012 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_MOCK_SYSTEM_STATE_H__ |
| 6 | #define CHROMEOS_PLATFORM_UPDATE_ENGINE_MOCK_SYSTEM_STATE_H__ |
| 7 | |
| 8 | #include <gmock/gmock.h> |
| 9 | |
Jay Srinivasan | 4348879 | 2012-06-19 00:25:31 -0700 | [diff] [blame^] | 10 | #include <policy/mock_device_policy.h> |
| 11 | #include "update_engine/system_state.h" |
Jay Srinivasan | 08fce04 | 2012-06-07 16:31:01 -0700 | [diff] [blame] | 12 | |
| 13 | namespace chromeos_update_engine { |
| 14 | |
| 15 | // Mock the SystemStateInterface so that we could lie that |
| 16 | // OOBE is completed even when there's no such marker file, etc. |
| 17 | class MockSystemState : public SystemState { |
Jay Srinivasan | 4348879 | 2012-06-19 00:25:31 -0700 | [diff] [blame^] | 18 | public: |
| 19 | MockSystemState() {} |
| 20 | virtual ~MockSystemState() {} |
| 21 | |
| 22 | MOCK_METHOD0(IsOOBEComplete, bool()); |
| 23 | MOCK_METHOD1(SetDevicePolicy, void(const policy::DevicePolicy*)); |
| 24 | MOCK_CONST_METHOD0(GetDevicePolicy, const policy::DevicePolicy*()); |
| 25 | |
| 26 | void SetConnectionManager(ConnectionManager* connection_manager) { |
| 27 | connection_manager_ = connection_manager; |
| 28 | } |
| 29 | |
| 30 | virtual ConnectionManager* GetConnectionManager() { |
| 31 | return connection_manager_; |
| 32 | } |
| 33 | |
| 34 | private: |
| 35 | ConnectionManager* connection_manager_; |
Jay Srinivasan | 08fce04 | 2012-06-07 16:31:01 -0700 | [diff] [blame] | 36 | }; |
| 37 | |
| 38 | } // namespeace chromeos_update_engine |
| 39 | |
| 40 | #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_MOCK_SYSTEM_STATE_H__ |