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_manager-inl.h b/policy_manager/policy_manager-inl.h
index 6c99be2..e4b9666 100644
--- a/policy_manager/policy_manager-inl.h
+++ b/policy_manager/policy_manager-inl.h
@@ -17,13 +17,14 @@
   std::string error;
 
   // First try calling the actual policy.
-  EvalStatus status = (policy_.get()->*policy_method)(&ec, &error, result,
-                                                      args...);
+  EvalStatus status = (policy_.get()->*policy_method)(&ec, state_.get(), &error,
+                                                      result, args...);
 
   if (status == EvalStatusFailed) {
     LOG(WARNING) << "PolicyRequest() failed with error: " << error;
     error.clear();
-    status = (default_policy_.*policy_method)(&ec, &error, result, args...);
+    status = (default_policy_.*policy_method)(&ec, state_.get(), &error,
+                                              result, args...);
 
     if (status == EvalStatusFailed) {
       LOG(WARNING) << "Request to DefaultPolicy also failed, passing error.";