PolicyManager: Add a new State class grouping the state providers.

The policy implementations need access to the providers to discover
the variables exposed by them. Instead of having global variables to
access each providers, we add a new State interface that groups all
the providers in the same way a provider groups all the variables.

This interface class allows to create a mock/fake class for testing
the policies.

Other minor fixes to the fakes are included in this patch.

BUG=chromium:338591
TEST=Simple unit test passes.

Change-Id: I7fe46dfc8416ee39ace3290628b7bae440213b29
Reviewed-on: https://chromium-review.googlesource.com/187705
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/policy.h b/policy_manager/policy.h
index b4a5a1e..7554824 100644
--- a/policy_manager/policy.h
+++ b/policy_manager/policy.h
@@ -6,6 +6,7 @@
 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_POLICY_MANAGER_POLICY_H
 
 #include "update_engine/policy_manager/evaluation_context.h"
+#include "update_engine/policy_manager/state.h"
 
 namespace chromeos_policy_manager {
 
@@ -27,15 +28,15 @@
   virtual ~Policy() {}
 
   // List of policy requests. A policy request takes an EvaluationContext as the
-  // first argument, a returned error message, a returned value and optionally
-  // followed by one or more arbitrary constant arguments.
+  // first argument, a State instance, a returned error message, a returned
+  // value and optionally followed by one or more arbitrary constant arguments.
   //
   // When the implementation fails, the method returns EvalStatusFailed and sets
   // the |error| string.
 
   // UpdateCheckAllowed returns whether it is allowed to request an update check
   // to Omaha.
-  virtual EvalStatus UpdateCheckAllowed(EvaluationContext* ec,
+  virtual EvalStatus UpdateCheckAllowed(EvaluationContext* ec, State* state,
                                         std::string* error,
                                         bool* result) const = 0;