blob: 4f4c787d1c44189ff452fdf02ce4fdd428e89400 [file] [log] [blame]
// Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "update_engine/policy_manager/fake_state.h"
#include "base/memory/scoped_ptr.h"
namespace chromeos_policy_manager {
FakeState::FakeState() : State(new FakeRandomProvider(),
new FakeShillProvider(),
new FakeSystemProvider(),
new FakeTimeProvider()) {
}
FakeState* FakeState::Construct() {
scoped_ptr<FakeState> fake_state(new FakeState());
if (!(fake_state->random_provider()->Init() &&
fake_state->shill_provider()->Init() &&
fake_state->system_provider()->Init() &&
fake_state->time_provider()->Init())) {
return NULL;
}
return fake_state.release();
}
} // namespace chromeos_policy_manager