blob: b509454e41a0ea8acb11607c158127a2d5b37a3b [file] [log] [blame]
Alex Deymo63784a52014-05-28 10:46:14 -07001// 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
Gilad Arnold48415f12014-06-27 07:10:58 -07005#ifndef UPDATE_ENGINE_UPDATE_MANAGER_FAKE_UPDATE_MANAGER_H_
6#define UPDATE_ENGINE_UPDATE_MANAGER_FAKE_UPDATE_MANAGER_H_
Alex Deymo63784a52014-05-28 10:46:14 -07007
8#include "update_engine/update_manager/update_manager.h"
9
10#include "update_engine/update_manager/default_policy.h"
11#include "update_engine/update_manager/fake_state.h"
12
13namespace chromeos_update_manager {
14
15class FakeUpdateManager : public UpdateManager {
16 public:
17 explicit FakeUpdateManager(chromeos_update_engine::ClockInterface* clock)
Gilad Arnoldb2271992014-06-19 12:35:24 -070018 : UpdateManager(clock, base::TimeDelta::FromSeconds(5), new FakeState()) {
Alex Deymo63784a52014-05-28 10:46:14 -070019 // The FakeUpdateManager uses a DefaultPolicy.
Gilad Arnolda23e4082014-07-17 11:40:43 -070020 set_policy(new DefaultPolicy(clock));
Alex Deymo63784a52014-05-28 10:46:14 -070021 }
22
23 // UpdateManager overrides.
24 using UpdateManager::set_policy;
25
26 FakeState* state() {
27 return reinterpret_cast<FakeState*>(UpdateManager::state());
28 }
29
30 private:
31 DISALLOW_COPY_AND_ASSIGN(FakeUpdateManager);
32};
33
34} // namespace chromeos_update_manager
35
Gilad Arnold48415f12014-06-27 07:10:58 -070036#endif // UPDATE_ENGINE_UPDATE_MANAGER_FAKE_UPDATE_MANAGER_H_