PolicyManager: Add a variable to tell when the Updater was started.
This patch adds a new const variable stating when was the updater
started in wallclock time. This value is required to schedule an
update check shortly after the update_engine starts, but use a
higher interval after the first update check.
BUG=chromium:358269
TEST=Added unittest.
Change-Id: Ife04c280207b5ccbf3a4a7828593cf01d1551a00
Reviewed-on: https://chromium-review.googlesource.com/197200
Reviewed-by: Alex Deymo <deymo@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
diff --git a/policy_manager/fake_updater_provider.h b/policy_manager/fake_updater_provider.h
index 17060ce..0413eb5 100644
--- a/policy_manager/fake_updater_provider.h
+++ b/policy_manager/fake_updater_provider.h
@@ -5,6 +5,8 @@
#ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_POLICY_MANAGER_FAKE_UPDATER_PROVIDER_H_
#define CHROMEOS_PLATFORM_UPDATE_ENGINE_POLICY_MANAGER_FAKE_UPDATER_PROVIDER_H_
+#include <string>
+
#include "update_engine/policy_manager/fake_variable.h"
#include "update_engine/policy_manager/updater_provider.h"
@@ -15,6 +17,10 @@
public:
FakeUpdaterProvider() {}
+ virtual FakeVariable<base::Time>* var_updater_started_time() override {
+ return &var_updater_started_time_;
+ }
+
virtual FakeVariable<base::Time>* var_last_checked_time() override {
return &var_last_checked_time_;
}
@@ -56,6 +62,8 @@
}
private:
+ FakeVariable<base::Time> var_updater_started_time_{
+ "updater_started_time", kVariableModePoll};
FakeVariable<base::Time> var_last_checked_time_{
"last_checked_time", kVariableModePoll};
FakeVariable<base::Time> var_update_completed_time_{