blob: 4f4c787d1c44189ff452fdf02ce4fdd428e89400 [file] [log] [blame]
Alex Deymo2de23f52014-02-26 14:30:13 -08001// 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
Alex Deymo2de23f52014-02-26 14:30:13 -08005#include "update_engine/policy_manager/fake_state.h"
Alex Deymo94c06162014-03-21 20:34:46 -07006
7#include "base/memory/scoped_ptr.h"
Alex Deymo2de23f52014-02-26 14:30:13 -08008
9namespace chromeos_policy_manager {
10
Alex Deymo94c06162014-03-21 20:34:46 -070011FakeState::FakeState() : State(new FakeRandomProvider(),
12 new FakeShillProvider(),
13 new FakeSystemProvider(),
14 new FakeTimeProvider()) {
15}
16
17FakeState* FakeState::Construct() {
18 scoped_ptr<FakeState> fake_state(new FakeState());
19 if (!(fake_state->random_provider()->Init() &&
20 fake_state->shill_provider()->Init() &&
21 fake_state->system_provider()->Init() &&
22 fake_state->time_provider()->Init())) {
23 return NULL;
24 }
25 return fake_state.release();
Alex Deymo2de23f52014-02-26 14:30:13 -080026}
27
28} // namespace chromeos_policy_manager