blob: 861b70aa74cfa52007075f53301a1e88b3c54817 [file] [log] [blame]
Gilad Arnold78a78112014-03-13 14:58:06 -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
Alex Deymo63784a52014-05-28 10:46:14 -07005#ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_UPDATE_MANAGER_FAKE_TIME_PROVIDER_H_
6#define CHROMEOS_PLATFORM_UPDATE_ENGINE_UPDATE_MANAGER_FAKE_TIME_PROVIDER_H_
Gilad Arnold78a78112014-03-13 14:58:06 -07007
Alex Deymo63784a52014-05-28 10:46:14 -07008#include "update_engine/update_manager/fake_variable.h"
9#include "update_engine/update_manager/time_provider.h"
Gilad Arnold78a78112014-03-13 14:58:06 -070010
Alex Deymo63784a52014-05-28 10:46:14 -070011namespace chromeos_update_manager {
Gilad Arnold78a78112014-03-13 14:58:06 -070012
13// Fake implementation of the TimeProvider base class.
14class FakeTimeProvider : public TimeProvider {
15 public:
16 FakeTimeProvider() {}
17
David Zeuthen21716e22014-04-23 15:42:05 -070018 virtual FakeVariable<base::Time>* var_curr_date() override {
19 return &var_curr_date_;
20 }
21
22 virtual FakeVariable<int>* var_curr_hour() override {
23 return &var_curr_hour_;
Gilad Arnold78a78112014-03-13 14:58:06 -070024 }
25
26 private:
David Zeuthen21716e22014-04-23 15:42:05 -070027 FakeVariable<base::Time> var_curr_date_{"curr_date", kVariableModePoll};
28 FakeVariable<int> var_curr_hour_{"curr_hour", kVariableModePoll};
29
Gilad Arnold78a78112014-03-13 14:58:06 -070030 DISALLOW_COPY_AND_ASSIGN(FakeTimeProvider);
31};
32
Alex Deymo63784a52014-05-28 10:46:14 -070033} // namespace chromeos_update_manager
Gilad Arnold78a78112014-03-13 14:58:06 -070034
Alex Deymo63784a52014-05-28 10:46:14 -070035#endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_UPDATE_MANAGER_FAKE_TIME_PROVIDER_H_