Jay Srinivasan | 55f50c2 | 2013-01-10 19:24:35 -0800 | [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 | #include "update_engine/mock_system_state.h" |
| 6 | #include "update_engine/update_attempter_mock.h" |
| 7 | |
| 8 | namespace chromeos_update_engine { |
| 9 | |
| 10 | // Mock the SystemStateInterface so that we could lie that |
| 11 | // OOBE is completed even when there's no such marker file, etc. |
Jay Srinivasan | ae4697c | 2013-03-18 17:08:08 -0700 | [diff] [blame] | 12 | MockSystemState::MockSystemState() |
| 13 | : default_request_params_(this), |
Alex Deymo | 4243291 | 2013-07-12 20:21:15 -0700 | [diff] [blame] | 14 | clock_(&default_clock_), |
| 15 | hardware_(&default_hardware_), |
Chris Sosa | aa18e16 | 2013-06-20 13:20:30 -0700 | [diff] [blame] | 16 | prefs_(&mock_prefs_), |
David Zeuthen | 526cb58 | 2013-08-06 12:26:18 -0700 | [diff] [blame^] | 17 | powerwash_safe_prefs_(&mock_powerwash_safe_prefs_), |
| 18 | p2p_manager_(&mock_p2p_manager_), |
| 19 | payload_state_(&mock_payload_state_) { |
Jay Srinivasan | ae4697c | 2013-03-18 17:08:08 -0700 | [diff] [blame] | 20 | request_params_ = &default_request_params_; |
Jay Srinivasan | 19409b7 | 2013-04-12 19:23:36 -0700 | [diff] [blame] | 21 | mock_payload_state_.Initialize(this); |
Jay Srinivasan | 55f50c2 | 2013-01-10 19:24:35 -0800 | [diff] [blame] | 22 | mock_gpio_handler_ = new testing::NiceMock<MockGpioHandler>(); |
| 23 | mock_update_attempter_ = new testing::NiceMock<UpdateAttempterMock>( |
| 24 | this, &dbus_); |
| 25 | } |
| 26 | |
| 27 | MockSystemState::~MockSystemState() { |
| 28 | delete mock_gpio_handler_; |
| 29 | } |
| 30 | |
| 31 | UpdateAttempter* MockSystemState::update_attempter() { |
| 32 | return mock_update_attempter_; |
| 33 | } |
| 34 | |
| 35 | } // namespeace chromeos_update_engine |
| 36 | |