update_engine: Relocate inference and storage of P2P related properties.

This change moves the inference of P2P related properties from
OmahaRequestAction to OmahaResponseHandlerAction, and their storage from
OmahaRequestParams to PayloadState. This is needed in order for the
UpdateCanStart policy to be able to decide P2P properties, which only
happens after the Omaha response is received and processed, and prior to
applying the update.  Further, P2P properties do not affect the Omaha
request, and so there's no reason for them to reside in
OmahaRequestParams nor decided as early as OmahaRequestAction.

Additional cleanup includes swapping expected/actual arguments to EXPECT
macros where appropriate, and removing redundant .Times(1) expectation
qualifiers.

BUG=chromium:384087
TEST=Unit tests.

Change-Id: I6d5b4b44745d5dab7e350bdf019dbf804bf196a1
Reviewed-on: https://chromium-review.googlesource.com/223618
Reviewed-by: Gilad Arnold <garnold@chromium.org>
Commit-Queue: Gilad Arnold <garnold@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
diff --git a/payload_state.cc b/payload_state.cc
index 4ce3d67..87965d7 100644
--- a/payload_state.cc
+++ b/payload_state.cc
@@ -41,12 +41,12 @@
 PayloadState::PayloadState()
     : prefs_(nullptr),
       using_p2p_for_downloading_(false),
+      p2p_num_attempts_(0),
       payload_attempt_number_(0),
       full_payload_attempt_number_(0),
       url_index_(0),
       url_failure_count_(0),
       url_switch_count_(0),
-      p2p_num_attempts_(0),
       attempt_num_bytes_downloaded_(0),
       attempt_connection_type_(metrics::ConnectionType::kUnknown),
       attempt_type_(AttemptType::kUpdate) {
@@ -357,8 +357,7 @@
                  "Can proceed with the download";
     return false;
   }
-  if (system_state_->request_params()->use_p2p_for_downloading() &&
-      !system_state_->request_params()->p2p_url().empty()) {
+  if (GetUsingP2PForDownloading() && !GetP2PUrl().empty()) {
     LOG(INFO) << "Payload backoff logic is disabled because download "
               << "will happen from local peer (via p2p).";
     return false;