blob: a60405bb1fb43973a0d01cb042e06c945db00d1b [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
Gilad Arnold48415f12014-06-27 07:10:58 -07005#ifndef UPDATE_ENGINE_UPDATE_MANAGER_FAKE_TIME_PROVIDER_H_
6#define 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
Alex Vakulenko157fe302014-08-11 15:59:58 -070018 FakeVariable<base::Time>* var_curr_date() override { return &var_curr_date_; }
19 FakeVariable<int>* var_curr_hour() override { return &var_curr_hour_; }
Gilad Arnold78a78112014-03-13 14:58:06 -070020
21 private:
David Zeuthen21716e22014-04-23 15:42:05 -070022 FakeVariable<base::Time> var_curr_date_{"curr_date", kVariableModePoll};
23 FakeVariable<int> var_curr_hour_{"curr_hour", kVariableModePoll};
24
Gilad Arnold78a78112014-03-13 14:58:06 -070025 DISALLOW_COPY_AND_ASSIGN(FakeTimeProvider);
26};
27
Alex Deymo63784a52014-05-28 10:46:14 -070028} // namespace chromeos_update_manager
Gilad Arnold78a78112014-03-13 14:58:06 -070029
Gilad Arnold48415f12014-06-27 07:10:58 -070030#endif // UPDATE_ENGINE_UPDATE_MANAGER_FAKE_TIME_PROVIDER_H_