update_engine: Mock out UpdateAttempter and OmahaRequestParams.

These classes are used by other classes so we need to have a way to
unit test those. This patch converts some public methods on these
classes to virtual methods so they can be mocked. It implements a
new MockOmahaRequestParams with all the public methods behaving like
the real object by default. This is now the default class used by the
FakeSystemState. Finally, the UpdateAttempterMock is renamed to
MockUpdateAttempter to be more consistent with other classes in
the project.

BUG=None
TEST=Unittest pass. Follow up CL using these classes also passes.

Change-Id: Iacb7e19d10c1526cea9659c27ab798cad126816f
Reviewed-on: https://chromium-review.googlesource.com/225855
Reviewed-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
diff --git a/update_attempter.h b/update_attempter.h
index 7732c08..6702f1b 100644
--- a/update_attempter.h
+++ b/update_attempter.h
@@ -102,7 +102,7 @@
   // having to reboot once the previous update has reached
   // UPDATE_STATUS_UPDATED_NEED_REBOOT state. This is used only
   // for testing purposes.
-  bool ResetStatus();
+  virtual bool ResetStatus();
 
   // Returns the current status in the out params. Returns true on success.
   virtual bool GetStatus(int64_t* last_checked_time,
@@ -136,9 +136,9 @@
   // This is the internal entry point for going through an
   // update. If the current status is idle invokes Update.
   // This is called by the DBus implementation.
-  void CheckForUpdate(const std::string& app_version,
-                      const std::string& omaha_url,
-                      bool is_interactive);
+  virtual void CheckForUpdate(const std::string& app_version,
+                              const std::string& omaha_url,
+                              bool is_interactive);
 
   // This is the internal entry point for going through a rollback. This will
   // attempt to run the postinstall on the non-active partition and set it as
@@ -186,7 +186,7 @@
   // cause a real-time policy fetch from the policy server. It just reloads the
   // latest value that libchromeos has cached. libchromeos fetches the policies
   // from the server asynchronously at its own frequency.
-  void RefreshDevicePolicy();
+  virtual void RefreshDevicePolicy();
 
   // Returns the boottime (CLOCK_BOOTTIME) recorded at the last
   // successful update. Returns false if the device has not updated.