blob: a73346ab6e8111e05af4468e0832b54145b232bc [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
5#ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_POLICY_MANAGER_FAKE_TIME_PROVIDER_H_
6#define CHROMEOS_PLATFORM_UPDATE_ENGINE_POLICY_MANAGER_FAKE_TIME_PROVIDER_H_
7
8#include "update_engine/policy_manager/fake_variable.h"
9#include "update_engine/policy_manager/time_provider.h"
10
11namespace chromeos_policy_manager {
12
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 virtual bool DoInit() override { return true; }
28
29 FakeVariable<base::Time> var_curr_date_{"curr_date", kVariableModePoll};
30 FakeVariable<int> var_curr_hour_{"curr_hour", kVariableModePoll};
31
Gilad Arnold78a78112014-03-13 14:58:06 -070032 DISALLOW_COPY_AND_ASSIGN(FakeTimeProvider);
33};
34
35} // namespace chromeos_policy_manager
36
37#endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_POLICY_MANAGER_FAKE_TIME_PROVIDER_H_