blob: 34a3813c9acaf43e5326f111a9b9fa9be35f778e [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 Arnoldfd45a732014-08-07 15:53:46 -070018 : UpdateManager(clock, base::TimeDelta::FromSeconds(5),
19 base::TimeDelta::FromHours(1), new FakeState()) {
Alex Deymo63784a52014-05-28 10:46:14 -070020 // The FakeUpdateManager uses a DefaultPolicy.
Gilad Arnolda23e4082014-07-17 11:40:43 -070021 set_policy(new DefaultPolicy(clock));
Alex Deymo63784a52014-05-28 10:46:14 -070022 }
23
24 // UpdateManager overrides.
25 using UpdateManager::set_policy;
26
27 FakeState* state() {
28 return reinterpret_cast<FakeState*>(UpdateManager::state());
29 }
30
31 private:
32 DISALLOW_COPY_AND_ASSIGN(FakeUpdateManager);
33};
34
35} // namespace chromeos_update_manager
36
Gilad Arnold48415f12014-06-27 07:10:58 -070037#endif // UPDATE_ENGINE_UPDATE_MANAGER_FAKE_UPDATE_MANAGER_H_