PolicyManager: Extend the EvaluationContext to handle IsTimeGreaterThan()

The EvaluationContext needs to know the point in time where the
current evaluation of a policy request started to be able to handle
time based values like IsTimeGreaterThan() efficiently and the
timeout for the current evaluation. This patch adds such method to
the EvaluationContext class and exposes a new ResetEvaluation()
method to allow restart an evaluation. The restart of an evaluation
is independent from the notification mechanism implemented by
RunOnValueChangeOrTimeout().

The documentation on the header file is updated and extended with an
example of the workflow.

BUG=chromium:358451
TEST=Unittests added.

Change-Id: I50b6ef9d582434d6ba0f466f7e650e4a2b442249
Reviewed-on: https://chromium-review.googlesource.com/195230
Reviewed-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
diff --git a/policy_manager/policy_manager_unittest.cc b/policy_manager/policy_manager_unittest.cc
index 1562727..9632609 100644
--- a/policy_manager/policy_manager_unittest.cc
+++ b/policy_manager/policy_manager_unittest.cc
@@ -12,6 +12,7 @@
 #include <gtest/gtest.h>
 #include <gmock/gmock.h>
 
+#include "update_engine/fake_clock.h"
 #include "update_engine/policy_manager/default_policy.h"
 #include "update_engine/policy_manager/fake_state.h"
 #include "update_engine/policy_manager/mock_policy.h"
@@ -21,6 +22,7 @@
 
 using base::Bind;
 using base::Callback;
+using chromeos_update_engine::FakeClock;
 using std::pair;
 using std::string;
 using std::vector;
@@ -31,6 +33,9 @@
 namespace chromeos_policy_manager {
 
 class PmPolicyManagerTest : public ::testing::Test {
+ public:
+  PmPolicyManagerTest() : pmut_(&fake_clock_) {}
+
  protected:
   virtual void SetUp() {
     fake_state_ = FakeState::Construct();
@@ -39,6 +44,7 @@
   }
 
   FakeState* fake_state_;
+  FakeClock fake_clock_;
   PolicyManager pmut_;
 };