blob: 0ee9e5eef6fe75c0a62d2c9c71d654a82ad57a55 [file] [log] [blame]
Jay Srinivasan55f50c22013-01-10 19:24:35 -08001// 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
8namespace 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 Srinivasanae4697c2013-03-18 17:08:08 -070012MockSystemState::MockSystemState()
13 : default_request_params_(this),
Alex Deymo42432912013-07-12 20:21:15 -070014 clock_(&default_clock_),
15 hardware_(&default_hardware_),
Chris Sosaaa18e162013-06-20 13:20:30 -070016 prefs_(&mock_prefs_),
17 powerwash_safe_prefs_(&mock_powerwash_safe_prefs_) {
Jay Srinivasanae4697c2013-03-18 17:08:08 -070018 request_params_ = &default_request_params_;
Jay Srinivasan19409b72013-04-12 19:23:36 -070019 mock_payload_state_.Initialize(this);
Jay Srinivasan55f50c22013-01-10 19:24:35 -080020 mock_gpio_handler_ = new testing::NiceMock<MockGpioHandler>();
21 mock_update_attempter_ = new testing::NiceMock<UpdateAttempterMock>(
22 this, &dbus_);
23}
24
25MockSystemState::~MockSystemState() {
26 delete mock_gpio_handler_;
27}
28
29UpdateAttempter* MockSystemState::update_attempter() {
30 return mock_update_attempter_;
31}
32
33} // namespeace chromeos_update_engine
34