update_engine: Cleanup omaha_request_action_unittest.cc.

This patch is a cleanup of the omaha_request_action_unittest. First
it moves members common to all test from the global scope to the
OmahaRequestActionTest class, including the global scope
FakeSystemState instance used on all tests. This fake_system_state
is initialized with a default OmahaRequestParams that is used by many
tests not caring about that parameter. It also sets the default prefs
to a FakePrefs instance, removing the need to create a temp directory
and initialize it in every test. Some tests still replace it with a
MockPrefs when they need to test that some prefs are checked by the
code (testing interaction), but most of them just want to provide a
working Prefs class.

With this change, also the test helper functions were moved to the
OmahaRequestActionTest class, removing the need to pass the optional
classes such as PrefsIterface, PayloadStateInterface, P2PManager and
ConnectionManager which in most tests were passed as nullptr meaning
that the default is used. Instead, with this change, tests that
require a different P2PManager instance for example just create it
and replace it on the fake_system_state_.

This change removes a lot of redundant default code that was hard to
maintain. Now a test requiring to manipulate other classes in the
FakeSystemState class, such as mocking out the HardwareInterface, can
just replace that without adding another parameter to the helper
functions.

BUG=chromium:428792
TEST=Unittest still pass.

Change-Id: Ia3306b11af867d2a1a09be8efae66f6b0326f030
Reviewed-on: https://chromium-review.googlesource.com/226715
Reviewed-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
diff --git a/omaha_request_action.h b/omaha_request_action.h
index 4501a84..6e4384a 100644
--- a/omaha_request_action.h
+++ b/omaha_request_action.h
@@ -146,7 +146,13 @@
   bool IsEvent() const { return event_.get() != nullptr; }
 
  private:
-  FRIEND_TEST(OmahaRequestActionTest, GetInstallDate);
+  FRIEND_TEST(OmahaRequestActionTest, GetInstallDateWhenNoPrefsNorOOBE);
+  FRIEND_TEST(OmahaRequestActionTest,
+              GetInstallDateWhenOOBECompletedWithInvalidDate);
+  FRIEND_TEST(OmahaRequestActionTest,
+              GetInstallDateWhenOOBECompletedWithValidDate);
+  FRIEND_TEST(OmahaRequestActionTest,
+              GetInstallDateWhenOOBECompletedDateChanges);
 
   // Enumeration used in PersistInstallDate().
   enum InstallDateProvisioningSource {