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. |
| 12 | MockSystemState::MockSystemState() : prefs_(&mock_prefs_) { |
| 13 | mock_payload_state_.Initialize(&mock_prefs_); |
| 14 | mock_gpio_handler_ = new testing::NiceMock<MockGpioHandler>(); |
| 15 | mock_update_attempter_ = new testing::NiceMock<UpdateAttempterMock>( |
| 16 | this, &dbus_); |
| 17 | } |
| 18 | |
| 19 | MockSystemState::~MockSystemState() { |
| 20 | delete mock_gpio_handler_; |
| 21 | } |
| 22 | |
| 23 | UpdateAttempter* MockSystemState::update_attempter() { |
| 24 | return mock_update_attempter_; |
| 25 | } |
| 26 | |
| 27 | } // namespeace chromeos_update_engine |
| 28 | |