update_engine: Simplify unittests in omaha_request_action_unittest.cc

This file has a ton of unittests that call the function
TestUpdateCheck() with specific parameters. The problem is if we want to
add a new parameter to the function, we either have to add the parameter
to all call sites (around 100 one of them, which is cumbersome) or add a
new function with default parameters (which will get ugly). So instead
just create a new structure |TestUpdateCheckParams| with default values
to use instead of passing parameters to the function itself. So:

- Removed one version of TestUpdateCheck().
- Removed TestRollbackCheck() and replaced with TestUpdateCheck().
- Also modified the output parameters of the TestUpdateCheck() to be in
  the class itself so unittests can just look them up.

BUG=none
TEST=unittest

Change-Id: I96b40bffb74d15ae4567652b0153179496b6a200
Reviewed-on: https://chromium-review.googlesource.com/1544865
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Amin Hassani <ahassani@chromium.org>
Reviewed-by: Xiaochu Liu <xiaochu@chromium.org>
Reviewed-by: Sen Jiang <senj@chromium.org>
diff --git a/omaha_request_action_unittest.cc b/omaha_request_action_unittest.cc
index e7c610f..ec08333 100644
--- a/omaha_request_action_unittest.cc
+++ b/omaha_request_action_unittest.cc
@@ -316,6 +316,19 @@
   std::unique_ptr<OmahaResponse> omaha_response_;
 };
 
+struct TestUpdateCheckParams {
+  string http_response;
+  int fail_http_response_code;
+  bool ping_only;
+  bool is_consumer_device;
+  int rollback_allowed_milestones;
+  bool is_policy_loaded;
+  ErrorCode expected_code;
+  metrics::CheckResult expected_check_result;
+  metrics::CheckReaction expected_check_reaction;
+  metrics::DownloadErrorCode expected_download_error_code;
+};
+
 class OmahaRequestActionTest : public ::testing::Test {
  protected:
   void SetUp() override {
@@ -340,56 +353,39 @@
 
     fake_system_state_.set_request_params(&request_params_);
     fake_system_state_.set_prefs(&fake_prefs_);
+
+    // Setting the default update check params. Lookup |TestUpdateCheck()|.
+    tuc_params_ = {
+        .http_response = "",
+        .fail_http_response_code = -1,
+        .ping_only = false,
+        .is_consumer_device = true,
+        .rollback_allowed_milestones = 0,
+        .is_policy_loaded = false,
+        .expected_code = ErrorCode::kSuccess,
+        .expected_check_result = metrics::CheckResult::kUpdateAvailable,
+        .expected_check_reaction = metrics::CheckReaction::kUpdating,
+        .expected_download_error_code = metrics::DownloadErrorCode::kUnset,
+    };
   }
 
-  // Returns true iff an output response was obtained from the
-  // OmahaRequestAction. |prefs| may be null, in which case a local MockPrefs
-  // is used. |payload_state| may be null, in which case a local mock is used.
-  // |p2p_manager| may be null, in which case a local mock is used.
-  // |connection_manager| may be null, in which case a local mock is used.
-  // out_response may be null. If |fail_http_response_code| is non-negative,
-  // the transfer will fail with that code. |ping_only| is passed through to the
-  // OmahaRequestAction constructor. out_post_data may be null; if non-null, the
-  // post-data received by the mock HttpFetcher is returned.
+  // This function uses the paramets in |tuc_params_| to do an update check. It
+  // will fill out |post_str| with the result data and |response| with
+  // |OmahaResponse|. Returns true iff an output response was obtained from the
+  // |OmahaRequestAction|. If |fail_http_response_code| is non-negative, the
+  // transfer will fail with that code. |ping_only| is passed through to the
+  // |OmahaRequestAction| constructor.
   //
   // The |expected_check_result|, |expected_check_reaction| and
-  // |expected_error_code| parameters are for checking expectations
-  // about reporting UpdateEngine.Check.{Result,Reaction,DownloadError}
-  // UMA statistics. Use the appropriate ::kUnset value to specify that
-  // the given metric should not be reported.
-  bool TestUpdateCheck(const string& http_response,
-                       int fail_http_response_code,
-                       bool ping_only,
-                       bool is_consumer_device,
-                       int rollback_allowed_milestones,
-                       bool is_policy_loaded,
-                       ErrorCode expected_code,
-                       metrics::CheckResult expected_check_result,
-                       metrics::CheckReaction expected_check_reaction,
-                       metrics::DownloadErrorCode expected_download_error_code,
-                       OmahaResponse* out_response,
-                       brillo::Blob* out_post_data);
+  // |expected_error_code| parameters are for checking expectations about
+  // reporting UpdateEngine.Check.{Result,Reaction,DownloadError} UMA
+  // statistics. Use the appropriate ::kUnset value to specify that the given
+  // metric should not be reported.
+  bool TestUpdateCheck();
 
-  // Overload of TestUpdateCheck that does not supply |is_consumer_device| or
-  // |rollback_allowed_milestones| which are only required for rollback tests.
-  bool TestUpdateCheck(const string& http_response,
-                       int fail_http_response_code,
-                       bool ping_only,
-                       ErrorCode expected_code,
-                       metrics::CheckResult expected_check_result,
-                       metrics::CheckReaction expected_check_reaction,
-                       metrics::DownloadErrorCode expected_download_error_code,
-                       OmahaResponse* out_response,
-                       brillo::Blob* out_post_data);
-
-  void TestRollbackCheck(bool is_consumer_device,
-                         int rollback_allowed_milestones,
-                         bool is_policy_loaded,
-                         OmahaResponse* out_response);
-
-  void TestEvent(OmahaEvent* event,
-                 const string& http_response,
-                 brillo::Blob* out_post_data);
+  // Tests events using |event| and |https_response|. It will fill up |post_str|
+  // with the result data.
+  void TestEvent(OmahaEvent* event, const string& http_response);
 
   // Runs and checks a ping test. |ping_only| indicates whether it should send
   // only a ping or also an updatecheck.
@@ -421,54 +417,52 @@
   OmahaRequestActionTestProcessorDelegate delegate_;
 
   bool test_http_fetcher_headers_{false};
+
+  TestUpdateCheckParams tuc_params_;
+
+  // TODO(ahassani): Add trailing _ to these two variables.
+  OmahaResponse response;
+  string post_str;
 };
 
-bool OmahaRequestActionTest::TestUpdateCheck(
-    const string& http_response,
-    int fail_http_response_code,
-    bool ping_only,
-    bool is_consumer_device,
-    int rollback_allowed_milestones,
-    bool is_policy_loaded,
-    ErrorCode expected_code,
-    metrics::CheckResult expected_check_result,
-    metrics::CheckReaction expected_check_reaction,
-    metrics::DownloadErrorCode expected_download_error_code,
-    OmahaResponse* out_response,
-    brillo::Blob* out_post_data) {
+bool OmahaRequestActionTest::TestUpdateCheck() {
   brillo::FakeMessageLoop loop(nullptr);
   loop.SetAsCurrent();
-  auto fetcher = std::make_unique<MockHttpFetcher>(
-      http_response.data(), http_response.size(), nullptr);
-  if (fail_http_response_code >= 0) {
-    fetcher->FailTransfer(fail_http_response_code);
+  auto fetcher =
+      std::make_unique<MockHttpFetcher>(tuc_params_.http_response.data(),
+                                        tuc_params_.http_response.size(),
+                                        nullptr);
+  if (tuc_params_.fail_http_response_code >= 0) {
+    fetcher->FailTransfer(tuc_params_.fail_http_response_code);
   }
   // This ensures the tests didn't forget to update fake_system_state_ if they
   // are not using the default request_params_.
   EXPECT_EQ(&request_params_, fake_system_state_.request_params());
 
   auto omaha_request_action = std::make_unique<OmahaRequestAction>(
-      &fake_system_state_, nullptr, std::move(fetcher), ping_only);
+      &fake_system_state_, nullptr, std::move(fetcher), tuc_params_.ping_only);
 
   auto mock_policy_provider =
       std::make_unique<NiceMock<policy::MockPolicyProvider>>();
   EXPECT_CALL(*mock_policy_provider, IsConsumerDevice())
-      .WillRepeatedly(Return(is_consumer_device));
+      .WillRepeatedly(Return(tuc_params_.is_consumer_device));
 
   EXPECT_CALL(*mock_policy_provider, device_policy_is_loaded())
-      .WillRepeatedly(Return(is_policy_loaded));
+      .WillRepeatedly(Return(tuc_params_.is_policy_loaded));
 
   const policy::MockDevicePolicy device_policy;
-  const bool get_allowed_milestone_succeeds = rollback_allowed_milestones >= 0;
+  const bool get_allowed_milestone_succeeds =
+      tuc_params_.rollback_allowed_milestones >= 0;
   EXPECT_CALL(device_policy, GetRollbackAllowedMilestones(_))
-      .WillRepeatedly(DoAll(SetArgPointee<0>(rollback_allowed_milestones),
-                            Return(get_allowed_milestone_succeeds)));
+      .WillRepeatedly(
+          DoAll(SetArgPointee<0>(tuc_params_.rollback_allowed_milestones),
+                Return(get_allowed_milestone_succeeds)));
 
   EXPECT_CALL(*mock_policy_provider, GetDevicePolicy())
       .WillRepeatedly(ReturnRef(device_policy));
   omaha_request_action->policy_provider_ = std::move(mock_policy_provider);
 
-  delegate_.expected_code_ = expected_code;
+  delegate_.expected_code_ = tuc_params_.expected_code;
   delegate_.interactive_ = request_params_.interactive();
   delegate_.test_http_fetcher_headers_ = test_http_fetcher_headers_;
   ActionProcessor processor;
@@ -484,75 +478,30 @@
               ReportUpdateCheckMetrics(_, _, _, _))
       .Times(AnyNumber());
 
-  EXPECT_CALL(*fake_system_state_.mock_metrics_reporter(),
-              ReportUpdateCheckMetrics(_,
-                                       expected_check_result,
-                                       expected_check_reaction,
-                                       expected_download_error_code))
-      .Times(ping_only ? 0 : 1);
+  EXPECT_CALL(
+      *fake_system_state_.mock_metrics_reporter(),
+      ReportUpdateCheckMetrics(_,
+                               tuc_params_.expected_check_result,
+                               tuc_params_.expected_check_reaction,
+                               tuc_params_.expected_download_error_code))
+      .Times(tuc_params_.ping_only ? 0 : 1);
 
   loop.PostTask(base::Bind(
       [](ActionProcessor* processor) { processor->StartProcessing(); },
       base::Unretained(&processor)));
   loop.Run();
   EXPECT_FALSE(loop.PendingTasks());
-  if (delegate_.omaha_response_ && out_response)
-    *out_response = *delegate_.omaha_response_;
-  if (out_post_data)
-    *out_post_data = delegate_.post_data_;
+  if (delegate_.omaha_response_)
+    response = *delegate_.omaha_response_;
+  post_str = string(delegate_.post_data_.begin(), delegate_.post_data_.end());
   return delegate_.omaha_response_ != nullptr;
 }
 
-bool OmahaRequestActionTest::TestUpdateCheck(
-    const string& http_response,
-    int fail_http_response_code,
-    bool ping_only,
-    ErrorCode expected_code,
-    metrics::CheckResult expected_check_result,
-    metrics::CheckReaction expected_check_reaction,
-    metrics::DownloadErrorCode expected_download_error_code,
-    OmahaResponse* out_response,
-    brillo::Blob* out_post_data) {
-  return TestUpdateCheck(http_response,
-                         fail_http_response_code,
-                         ping_only,
-                         true,   // is_consumer_device
-                         0,      // rollback_allowed_milestones
-                         false,  // is_policy_loaded
-                         expected_code,
-                         expected_check_result,
-                         expected_check_reaction,
-                         expected_download_error_code,
-                         out_response,
-                         out_post_data);
-}
-
-void OmahaRequestActionTest::TestRollbackCheck(bool is_consumer_device,
-                                               int rollback_allowed_milestones,
-                                               bool is_policy_loaded,
-                                               OmahaResponse* out_response) {
-  fake_update_response_.deadline = "20101020";
-  ASSERT_TRUE(TestUpdateCheck(fake_update_response_.GetUpdateResponse(),
-                              -1,
-                              false,  // ping_only
-                              is_consumer_device,
-                              rollback_allowed_milestones,
-                              is_policy_loaded,
-                              ErrorCode::kSuccess,
-                              metrics::CheckResult::kUpdateAvailable,
-                              metrics::CheckReaction::kUpdating,
-                              metrics::DownloadErrorCode::kUnset,
-                              out_response,
-                              nullptr));
-  ASSERT_TRUE(out_response->update_exists);
-}
-
 // Tests Event requests -- they should always succeed. |out_post_data| may be
 // null; if non-null, the post-data received by the mock HttpFetcher is
 // returned.
 void OmahaRequestActionTest::TestEvent(OmahaEvent* event,
-                                       const string& http_response,
-                                       brillo::Blob* out_post_data) {
+                                       const string& http_response) {
   brillo::FakeMessageLoop loop(nullptr);
   loop.SetAsCurrent();
 
@@ -572,100 +521,69 @@
   loop.Run();
   EXPECT_FALSE(loop.PendingTasks());
 
-  if (out_post_data)
-    *out_post_data = delegate_.post_data_;
+  post_str = string(delegate_.post_data_.begin(), delegate_.post_data_.end());
 }
 
 TEST_F(OmahaRequestActionTest, RejectEntities) {
-  OmahaResponse response;
   fake_update_response_.include_entity = true;
-  ASSERT_FALSE(TestUpdateCheck(fake_update_response_.GetNoUpdateResponse(),
-                               -1,
-                               false,  // ping_only
-                               ErrorCode::kOmahaRequestXMLHasEntityDecl,
-                               metrics::CheckResult::kParsingError,
-                               metrics::CheckReaction::kUnset,
-                               metrics::DownloadErrorCode::kUnset,
-                               &response,
-                               nullptr));
+  tuc_params_.http_response = fake_update_response_.GetNoUpdateResponse();
+  tuc_params_.expected_code = ErrorCode::kOmahaRequestXMLHasEntityDecl;
+  tuc_params_.expected_check_result = metrics::CheckResult::kParsingError;
+  tuc_params_.expected_check_reaction = metrics::CheckReaction::kUnset;
+
+  ASSERT_FALSE(TestUpdateCheck());
   EXPECT_FALSE(response.update_exists);
 }
 
 TEST_F(OmahaRequestActionTest, NoUpdateTest) {
-  OmahaResponse response;
-  ASSERT_TRUE(TestUpdateCheck(fake_update_response_.GetNoUpdateResponse(),
-                              -1,
-                              false,  // ping_only
-                              ErrorCode::kSuccess,
-                              metrics::CheckResult::kNoUpdateAvailable,
-                              metrics::CheckReaction::kUnset,
-                              metrics::DownloadErrorCode::kUnset,
-                              &response,
-                              nullptr));
+  tuc_params_.http_response = fake_update_response_.GetNoUpdateResponse();
+  tuc_params_.expected_check_result = metrics::CheckResult::kNoUpdateAvailable;
+  tuc_params_.expected_check_reaction = metrics::CheckReaction::kUnset;
+
+  ASSERT_TRUE(TestUpdateCheck());
   EXPECT_FALSE(response.update_exists);
 }
 
 TEST_F(OmahaRequestActionTest, MultiAppNoUpdateTest) {
-  OmahaResponse response;
   fake_update_response_.multi_app_no_update = true;
-  ASSERT_TRUE(TestUpdateCheck(fake_update_response_.GetNoUpdateResponse(),
-                              -1,
-                              false,  // ping_only
-                              ErrorCode::kSuccess,
-                              metrics::CheckResult::kNoUpdateAvailable,
-                              metrics::CheckReaction::kUnset,
-                              metrics::DownloadErrorCode::kUnset,
-                              &response,
-                              nullptr));
+  tuc_params_.http_response = fake_update_response_.GetNoUpdateResponse();
+  tuc_params_.expected_check_result = metrics::CheckResult::kNoUpdateAvailable;
+  tuc_params_.expected_check_reaction = metrics::CheckReaction::kUnset;
+
+  ASSERT_TRUE(TestUpdateCheck());
   EXPECT_FALSE(response.update_exists);
 }
 
 TEST_F(OmahaRequestActionTest, MultiAppNoPartialUpdateTest) {
-  OmahaResponse response;
   fake_update_response_.multi_app_no_update = true;
-  ASSERT_TRUE(TestUpdateCheck(fake_update_response_.GetUpdateResponse(),
-                              -1,
-                              false,  // ping_only
-                              ErrorCode::kSuccess,
-                              metrics::CheckResult::kNoUpdateAvailable,
-                              metrics::CheckReaction::kUnset,
-                              metrics::DownloadErrorCode::kUnset,
-                              &response,
-                              nullptr));
+  tuc_params_.http_response = fake_update_response_.GetUpdateResponse();
+  tuc_params_.expected_check_result = metrics::CheckResult::kNoUpdateAvailable;
+  tuc_params_.expected_check_reaction = metrics::CheckReaction::kUnset;
+
+  ASSERT_TRUE(TestUpdateCheck());
   EXPECT_FALSE(response.update_exists);
 }
 
 TEST_F(OmahaRequestActionTest, NoSelfUpdateTest) {
-  OmahaResponse response;
-  ASSERT_TRUE(TestUpdateCheck(
+  tuc_params_.http_response =
       "<response><app><updatecheck status=\"ok\"><manifest><actions><action "
       "event=\"postinstall\" noupdate=\"true\"/></actions>"
-      "</manifest></updatecheck></app></response>",
-      -1,
-      false,  // ping_only
-      ErrorCode::kSuccess,
-      metrics::CheckResult::kNoUpdateAvailable,
-      metrics::CheckReaction::kUnset,
-      metrics::DownloadErrorCode::kUnset,
-      &response,
-      nullptr));
+      "</manifest></updatecheck></app></response>";
+  tuc_params_.expected_check_result = metrics::CheckResult::kNoUpdateAvailable;
+  tuc_params_.expected_check_reaction = metrics::CheckReaction::kUnset;
+
+  ASSERT_TRUE(TestUpdateCheck());
   EXPECT_FALSE(response.update_exists);
 }
 
 // Test that all the values in the response are parsed in a normal update
 // response.
 TEST_F(OmahaRequestActionTest, ValidUpdateTest) {
-  OmahaResponse response;
   fake_update_response_.deadline = "20101020";
-  ASSERT_TRUE(TestUpdateCheck(fake_update_response_.GetUpdateResponse(),
-                              -1,
-                              false,  // ping_only
-                              ErrorCode::kSuccess,
-                              metrics::CheckResult::kUpdateAvailable,
-                              metrics::CheckReaction::kUpdating,
-                              metrics::DownloadErrorCode::kUnset,
-                              &response,
-                              nullptr));
+  tuc_params_.http_response = fake_update_response_.GetUpdateResponse();
+
+  ASSERT_TRUE(TestUpdateCheck());
+
   EXPECT_TRUE(response.update_exists);
   EXPECT_EQ(fake_update_response_.version, response.version);
   EXPECT_EQ("", response.system_version);
@@ -686,17 +604,11 @@
 }
 
 TEST_F(OmahaRequestActionTest, MultiPackageUpdateTest) {
-  OmahaResponse response;
   fake_update_response_.multi_package = true;
-  ASSERT_TRUE(TestUpdateCheck(fake_update_response_.GetUpdateResponse(),
-                              -1,
-                              false,  // ping_only
-                              ErrorCode::kSuccess,
-                              metrics::CheckResult::kUpdateAvailable,
-                              metrics::CheckReaction::kUpdating,
-                              metrics::DownloadErrorCode::kUnset,
-                              &response,
-                              nullptr));
+  tuc_params_.http_response = fake_update_response_.GetUpdateResponse();
+
+  ASSERT_TRUE(TestUpdateCheck());
+
   EXPECT_TRUE(response.update_exists);
   EXPECT_EQ(fake_update_response_.version, response.version);
   EXPECT_EQ(fake_update_response_.GetPayloadUrl(),
@@ -715,17 +627,11 @@
 }
 
 TEST_F(OmahaRequestActionTest, MultiAppUpdateTest) {
-  OmahaResponse response;
   fake_update_response_.multi_app = true;
-  ASSERT_TRUE(TestUpdateCheck(fake_update_response_.GetUpdateResponse(),
-                              -1,
-                              false,  // ping_only
-                              ErrorCode::kSuccess,
-                              metrics::CheckResult::kUpdateAvailable,
-                              metrics::CheckReaction::kUpdating,
-                              metrics::DownloadErrorCode::kUnset,
-                              &response,
-                              nullptr));
+  tuc_params_.http_response = fake_update_response_.GetUpdateResponse();
+
+  ASSERT_TRUE(TestUpdateCheck());
+
   EXPECT_TRUE(response.update_exists);
   EXPECT_EQ(fake_update_response_.version, response.version);
   EXPECT_EQ(fake_update_response_.GetPayloadUrl(),
@@ -744,20 +650,13 @@
 }
 
 TEST_F(OmahaRequestActionTest, MultiAppAndSystemUpdateTest) {
-  OmahaResponse response;
   fake_update_response_.multi_app = true;
-  // trigger the lining up of the app and system versions
+  // Trigger the lining up of the app and system versions.
   request_params_.set_system_app_id(fake_update_response_.app_id2);
+  tuc_params_.http_response = fake_update_response_.GetUpdateResponse();
 
-  ASSERT_TRUE(TestUpdateCheck(fake_update_response_.GetUpdateResponse(),
-                              -1,
-                              false,  // ping_only
-                              ErrorCode::kSuccess,
-                              metrics::CheckResult::kUpdateAvailable,
-                              metrics::CheckReaction::kUpdating,
-                              metrics::DownloadErrorCode::kUnset,
-                              &response,
-                              nullptr));
+  ASSERT_TRUE(TestUpdateCheck());
+
   EXPECT_TRUE(response.update_exists);
   EXPECT_EQ(fake_update_response_.version, response.version);
   EXPECT_EQ(fake_update_response_.version2, response.system_version);
@@ -777,18 +676,12 @@
 }
 
 TEST_F(OmahaRequestActionTest, MultiAppPartialUpdateTest) {
-  OmahaResponse response;
   fake_update_response_.multi_app = true;
   fake_update_response_.multi_app_self_update = true;
-  ASSERT_TRUE(TestUpdateCheck(fake_update_response_.GetUpdateResponse(),
-                              -1,
-                              false,  // ping_only
-                              ErrorCode::kSuccess,
-                              metrics::CheckResult::kUpdateAvailable,
-                              metrics::CheckReaction::kUpdating,
-                              metrics::DownloadErrorCode::kUnset,
-                              &response,
-                              nullptr));
+  tuc_params_.http_response = fake_update_response_.GetUpdateResponse();
+
+  ASSERT_TRUE(TestUpdateCheck());
+
   EXPECT_TRUE(response.update_exists);
   EXPECT_EQ(fake_update_response_.version, response.version);
   EXPECT_EQ("", response.system_version);
@@ -805,18 +698,12 @@
 }
 
 TEST_F(OmahaRequestActionTest, MultiAppMultiPackageUpdateTest) {
-  OmahaResponse response;
   fake_update_response_.multi_app = true;
   fake_update_response_.multi_package = true;
-  ASSERT_TRUE(TestUpdateCheck(fake_update_response_.GetUpdateResponse(),
-                              -1,
-                              false,  // ping_only
-                              ErrorCode::kSuccess,
-                              metrics::CheckResult::kUpdateAvailable,
-                              metrics::CheckReaction::kUpdating,
-                              metrics::DownloadErrorCode::kUnset,
-                              &response,
-                              nullptr));
+  tuc_params_.http_response = fake_update_response_.GetUpdateResponse();
+
+  ASSERT_TRUE(TestUpdateCheck());
+
   EXPECT_TRUE(response.update_exists);
   EXPECT_EQ(fake_update_response_.version, response.version);
   EXPECT_EQ("", response.system_version);
@@ -842,55 +729,42 @@
 }
 
 TEST_F(OmahaRequestActionTest, PowerwashTest) {
-  OmahaResponse response;
   fake_update_response_.powerwash = true;
-  ASSERT_TRUE(TestUpdateCheck(fake_update_response_.GetUpdateResponse(),
-                              -1,
-                              false,  // ping_only
-                              ErrorCode::kSuccess,
-                              metrics::CheckResult::kUpdateAvailable,
-                              metrics::CheckReaction::kUpdating,
-                              metrics::DownloadErrorCode::kUnset,
-                              &response,
-                              nullptr));
+  tuc_params_.http_response = fake_update_response_.GetUpdateResponse();
+
+  ASSERT_TRUE(TestUpdateCheck());
+
   EXPECT_TRUE(response.update_exists);
   EXPECT_TRUE(response.powerwash_required);
 }
 
 TEST_F(OmahaRequestActionTest, ExtraHeadersSentInteractiveTest) {
-  OmahaResponse response;
   request_params_.set_interactive(true);
   test_http_fetcher_headers_ = true;
-  ASSERT_FALSE(TestUpdateCheck("invalid xml>",
-                               -1,
-                               false,  // ping_only
-                               ErrorCode::kOmahaRequestXMLParseError,
-                               metrics::CheckResult::kParsingError,
-                               metrics::CheckReaction::kUnset,
-                               metrics::DownloadErrorCode::kUnset,
-                               &response,
-                               nullptr));
+  tuc_params_.http_response = "invalid xml>";
+  tuc_params_.expected_code = ErrorCode::kOmahaRequestXMLParseError;
+  tuc_params_.expected_check_result = metrics::CheckResult::kParsingError;
+  tuc_params_.expected_check_reaction = metrics::CheckReaction::kUnset;
+
+  ASSERT_FALSE(TestUpdateCheck());
+
   EXPECT_FALSE(response.update_exists);
 }
 
 TEST_F(OmahaRequestActionTest, ExtraHeadersSentNoInteractiveTest) {
-  OmahaResponse response;
   request_params_.set_interactive(false);
   test_http_fetcher_headers_ = true;
-  ASSERT_FALSE(TestUpdateCheck("invalid xml>",
-                               -1,
-                               false,  // ping_only
-                               ErrorCode::kOmahaRequestXMLParseError,
-                               metrics::CheckResult::kParsingError,
-                               metrics::CheckReaction::kUnset,
-                               metrics::DownloadErrorCode::kUnset,
-                               &response,
-                               nullptr));
+  tuc_params_.http_response = "invalid xml>";
+  tuc_params_.expected_code = ErrorCode::kOmahaRequestXMLParseError;
+  tuc_params_.expected_check_result = metrics::CheckResult::kParsingError;
+  tuc_params_.expected_check_reaction = metrics::CheckReaction::kUnset;
+
+  ASSERT_FALSE(TestUpdateCheck());
+
   EXPECT_FALSE(response.update_exists);
 }
 
 TEST_F(OmahaRequestActionTest, ValidUpdateBlockedByConnection) {
-  OmahaResponse response;
   // Set up a connection manager that doesn't allow a valid update over
   // the current ethernet connection.
   MockConnectionManager mock_cm;
@@ -903,24 +777,19 @@
   EXPECT_CALL(mock_cm, IsUpdateAllowedOver(ConnectionType::kEthernet, _))
       .WillRepeatedly(Return(false));
 
-  ASSERT_FALSE(TestUpdateCheck(fake_update_response_.GetUpdateResponse(),
-                               -1,
-                               false,  // ping_only
-                               ErrorCode::kOmahaUpdateIgnoredPerPolicy,
-                               metrics::CheckResult::kUpdateAvailable,
-                               metrics::CheckReaction::kIgnored,
-                               metrics::DownloadErrorCode::kUnset,
-                               &response,
-                               nullptr));
+  tuc_params_.http_response = fake_update_response_.GetUpdateResponse();
+  tuc_params_.expected_code = ErrorCode::kOmahaUpdateIgnoredPerPolicy;
+  tuc_params_.expected_check_reaction = metrics::CheckReaction::kIgnored;
+
+  ASSERT_FALSE(TestUpdateCheck());
+
   EXPECT_FALSE(response.update_exists);
 }
 
 TEST_F(OmahaRequestActionTest, ValidUpdateOverCellularAllowedByDevicePolicy) {
   // This test tests that update over cellular is allowed as device policy
   // says yes.
-  OmahaResponse response;
   MockConnectionManager mock_cm;
-
   fake_system_state_.set_connection_manager(&mock_cm);
 
   EXPECT_CALL(mock_cm, GetConnectionProperties(_, _))
@@ -932,24 +801,17 @@
   EXPECT_CALL(mock_cm, IsUpdateAllowedOver(ConnectionType::kCellular, _))
       .WillRepeatedly(Return(true));
 
-  ASSERT_TRUE(TestUpdateCheck(fake_update_response_.GetUpdateResponse(),
-                              -1,
-                              false,  // ping_only
-                              ErrorCode::kSuccess,
-                              metrics::CheckResult::kUpdateAvailable,
-                              metrics::CheckReaction::kUpdating,
-                              metrics::DownloadErrorCode::kUnset,
-                              &response,
-                              nullptr));
+  tuc_params_.http_response = fake_update_response_.GetUpdateResponse();
+
+  ASSERT_TRUE(TestUpdateCheck());
+
   EXPECT_TRUE(response.update_exists);
 }
 
 TEST_F(OmahaRequestActionTest, ValidUpdateOverCellularBlockedByDevicePolicy) {
   // This test tests that update over cellular is blocked as device policy
   // says no.
-  OmahaResponse response;
   MockConnectionManager mock_cm;
-
   fake_system_state_.set_connection_manager(&mock_cm);
 
   EXPECT_CALL(mock_cm, GetConnectionProperties(_, _))
@@ -961,15 +823,12 @@
   EXPECT_CALL(mock_cm, IsUpdateAllowedOver(ConnectionType::kCellular, _))
       .WillRepeatedly(Return(false));
 
-  ASSERT_FALSE(TestUpdateCheck(fake_update_response_.GetUpdateResponse(),
-                               -1,
-                               false,  // ping_only
-                               ErrorCode::kOmahaUpdateIgnoredPerPolicy,
-                               metrics::CheckResult::kUpdateAvailable,
-                               metrics::CheckReaction::kIgnored,
-                               metrics::DownloadErrorCode::kUnset,
-                               &response,
-                               nullptr));
+  tuc_params_.http_response = fake_update_response_.GetUpdateResponse();
+  tuc_params_.expected_code = ErrorCode::kOmahaUpdateIgnoredPerPolicy;
+  tuc_params_.expected_check_reaction = metrics::CheckReaction::kIgnored;
+
+  ASSERT_FALSE(TestUpdateCheck());
+
   EXPECT_FALSE(response.update_exists);
 }
 
@@ -977,9 +836,7 @@
        ValidUpdateOverCellularAllowedByUserPermissionTrue) {
   // This test tests that, when device policy is not set, update over cellular
   // is allowed as permission for update over cellular is set to true.
-  OmahaResponse response;
   MockConnectionManager mock_cm;
-
   fake_prefs_.SetBoolean(kPrefsUpdateOverCellularPermission, true);
   fake_system_state_.set_connection_manager(&mock_cm);
 
@@ -992,15 +849,10 @@
   EXPECT_CALL(mock_cm, IsUpdateAllowedOver(ConnectionType::kCellular, _))
       .WillRepeatedly(Return(true));
 
-  ASSERT_TRUE(TestUpdateCheck(fake_update_response_.GetUpdateResponse(),
-                              -1,
-                              false,  // ping_only
-                              ErrorCode::kSuccess,
-                              metrics::CheckResult::kUpdateAvailable,
-                              metrics::CheckReaction::kUpdating,
-                              metrics::DownloadErrorCode::kUnset,
-                              &response,
-                              nullptr));
+  tuc_params_.http_response = fake_update_response_.GetUpdateResponse();
+
+  ASSERT_TRUE(TestUpdateCheck());
+
   EXPECT_TRUE(response.update_exists);
 }
 
@@ -1009,7 +861,6 @@
   // This test tests that, when device policy is not set and permission for
   // update over cellular is set to false or does not exist, update over
   // cellular is blocked as update target does not match the omaha response.
-  OmahaResponse response;
   MockConnectionManager mock_cm;
   // A version different from the version in omaha response.
   string diff_version = "99.99.99";
@@ -1030,15 +881,12 @@
   EXPECT_CALL(mock_cm, IsUpdateAllowedOver(ConnectionType::kCellular, _))
       .WillRepeatedly(Return(true));
 
-  ASSERT_FALSE(TestUpdateCheck(fake_update_response_.GetUpdateResponse(),
-                               -1,
-                               false,  // ping_only
-                               ErrorCode::kOmahaUpdateIgnoredOverCellular,
-                               metrics::CheckResult::kUpdateAvailable,
-                               metrics::CheckReaction::kIgnored,
-                               metrics::DownloadErrorCode::kUnset,
-                               &response,
-                               nullptr));
+  tuc_params_.http_response = fake_update_response_.GetUpdateResponse();
+  tuc_params_.expected_code = ErrorCode::kOmahaUpdateIgnoredOverCellular;
+  tuc_params_.expected_check_reaction = metrics::CheckReaction::kIgnored;
+
+  ASSERT_FALSE(TestUpdateCheck());
+
   EXPECT_FALSE(response.update_exists);
 }
 
@@ -1047,7 +895,6 @@
   // This test tests that, when device policy is not set and permission for
   // update over cellular is set to false or does not exist, update over
   // cellular is allowed as update target matches the omaha response.
-  OmahaResponse response;
   MockConnectionManager mock_cm;
   // A version same as the version in omaha response.
   string new_version = fake_update_response_.version;
@@ -1067,96 +914,67 @@
   EXPECT_CALL(mock_cm, IsUpdateAllowedOver(ConnectionType::kCellular, _))
       .WillRepeatedly(Return(true));
 
-  ASSERT_TRUE(TestUpdateCheck(fake_update_response_.GetUpdateResponse(),
-                              -1,
-                              false,  // ping_only
-                              ErrorCode::kSuccess,
-                              metrics::CheckResult::kUpdateAvailable,
-                              metrics::CheckReaction::kUpdating,
-                              metrics::DownloadErrorCode::kUnset,
-                              &response,
-                              nullptr));
+  tuc_params_.http_response = fake_update_response_.GetUpdateResponse();
+
+  ASSERT_TRUE(TestUpdateCheck());
+
   EXPECT_TRUE(response.update_exists);
 }
 
 TEST_F(OmahaRequestActionTest, ValidUpdateBlockedByRollback) {
   string rollback_version = "1234.0.0";
-  OmahaResponse response;
-
   MockPayloadState mock_payload_state;
   fake_system_state_.set_payload_state(&mock_payload_state);
+  fake_update_response_.version = rollback_version;
+  tuc_params_.http_response = fake_update_response_.GetUpdateResponse();
+  tuc_params_.expected_code = ErrorCode::kOmahaUpdateIgnoredPerPolicy;
+  tuc_params_.expected_check_reaction = metrics::CheckReaction::kIgnored;
 
   EXPECT_CALL(mock_payload_state, GetRollbackVersion())
       .WillRepeatedly(Return(rollback_version));
 
-  fake_update_response_.version = rollback_version;
-  ASSERT_FALSE(TestUpdateCheck(fake_update_response_.GetUpdateResponse(),
-                               -1,
-                               false,  // ping_only
-                               ErrorCode::kOmahaUpdateIgnoredPerPolicy,
-                               metrics::CheckResult::kUpdateAvailable,
-                               metrics::CheckReaction::kIgnored,
-                               metrics::DownloadErrorCode::kUnset,
-                               &response,
-                               nullptr));
+  ASSERT_FALSE(TestUpdateCheck());
+
   EXPECT_FALSE(response.update_exists);
 }
 
 // Verify that update checks called during OOBE will not try to download an
 // update if the response doesn't include the deadline field.
 TEST_F(OmahaRequestActionTest, SkipNonCriticalUpdatesBeforeOOBE) {
-  OmahaResponse response;
   fake_system_state_.fake_hardware()->UnsetIsOOBEComplete();
+  tuc_params_.http_response = fake_update_response_.GetUpdateResponse();
+  tuc_params_.expected_code = ErrorCode::kNonCriticalUpdateInOOBE;
+  tuc_params_.expected_check_result = metrics::CheckResult::kParsingError;
+  tuc_params_.expected_check_reaction = metrics::CheckReaction::kUnset;
 
   // TODO(senj): set better default value for metrics::checkresult in
   // OmahaRequestAction::ActionCompleted.
-  ASSERT_FALSE(TestUpdateCheck(fake_update_response_.GetUpdateResponse(),
-                               -1,
-                               false,  // ping_only
-                               ErrorCode::kNonCriticalUpdateInOOBE,
-                               metrics::CheckResult::kParsingError,
-                               metrics::CheckReaction::kUnset,
-                               metrics::DownloadErrorCode::kUnset,
-                               &response,
-                               nullptr));
+  ASSERT_FALSE(TestUpdateCheck());
+
   EXPECT_FALSE(response.update_exists);
 }
 
 // Verify that the IsOOBEComplete() value is ignored when the OOBE flow is not
 // enabled.
 TEST_F(OmahaRequestActionTest, SkipNonCriticalUpdatesBeforeOOBEDisabled) {
-  OmahaResponse response;
   fake_system_state_.fake_hardware()->UnsetIsOOBEComplete();
   fake_system_state_.fake_hardware()->SetIsOOBEEnabled(false);
+  tuc_params_.http_response = fake_update_response_.GetUpdateResponse();
 
-  ASSERT_TRUE(TestUpdateCheck(fake_update_response_.GetUpdateResponse(),
-                              -1,
-                              false,  // ping_only
-                              ErrorCode::kSuccess,
-                              metrics::CheckResult::kUpdateAvailable,
-                              metrics::CheckReaction::kUpdating,
-                              metrics::DownloadErrorCode::kUnset,
-                              &response,
-                              nullptr));
+  ASSERT_TRUE(TestUpdateCheck());
+
   EXPECT_TRUE(response.update_exists);
 }
 
 // Verify that update checks called during OOBE will still try to download an
 // update if the response includes the deadline field.
 TEST_F(OmahaRequestActionTest, SkipNonCriticalUpdatesBeforeOOBEDeadlineSet) {
-  OmahaResponse response;
   fake_system_state_.fake_hardware()->UnsetIsOOBEComplete();
   fake_update_response_.deadline = "20101020";
+  tuc_params_.http_response = fake_update_response_.GetUpdateResponse();
 
-  ASSERT_TRUE(TestUpdateCheck(fake_update_response_.GetUpdateResponse(),
-                              -1,
-                              false,  // ping_only
-                              ErrorCode::kSuccess,
-                              metrics::CheckResult::kUpdateAvailable,
-                              metrics::CheckReaction::kUpdating,
-                              metrics::DownloadErrorCode::kUnset,
-                              &response,
-                              nullptr));
+  ASSERT_TRUE(TestUpdateCheck());
+
   EXPECT_TRUE(response.update_exists);
 }
 
@@ -1164,21 +982,18 @@
 // update if a rollback happened, even when the response includes the deadline
 // field.
 TEST_F(OmahaRequestActionTest, SkipNonCriticalUpdatesBeforeOOBERollback) {
-  OmahaResponse response;
   fake_system_state_.fake_hardware()->UnsetIsOOBEComplete();
   fake_update_response_.deadline = "20101020";
+  tuc_params_.http_response = fake_update_response_.GetUpdateResponse();
+  tuc_params_.expected_code = ErrorCode::kNonCriticalUpdateInOOBE;
+  tuc_params_.expected_check_result = metrics::CheckResult::kParsingError;
+  tuc_params_.expected_check_reaction = metrics::CheckReaction::kUnset;
+
   EXPECT_CALL(*(fake_system_state_.mock_payload_state()), GetRollbackHappened())
       .WillOnce(Return(true));
 
-  ASSERT_FALSE(TestUpdateCheck(fake_update_response_.GetUpdateResponse(),
-                               -1,
-                               false,  // ping_only
-                               ErrorCode::kNonCriticalUpdateInOOBE,
-                               metrics::CheckResult::kParsingError,
-                               metrics::CheckReaction::kUnset,
-                               metrics::DownloadErrorCode::kUnset,
-                               &response,
-                               nullptr));
+  ASSERT_FALSE(TestUpdateCheck());
+
   EXPECT_FALSE(response.update_exists);
 }
 
@@ -1188,11 +1003,14 @@
 // kOmahaUpdateIgnoredOverCellular error in this case  might cause undesired UX
 // in OOBE (warning the user about an update that will be skipped).
 TEST_F(OmahaRequestActionTest, SkipNonCriticalUpdatesInOOBEOverCellular) {
-  OmahaResponse response;
   fake_system_state_.fake_hardware()->UnsetIsOOBEComplete();
 
   MockConnectionManager mock_cm;
   fake_system_state_.set_connection_manager(&mock_cm);
+  tuc_params_.http_response = fake_update_response_.GetUpdateResponse();
+  tuc_params_.expected_code = ErrorCode::kNonCriticalUpdateInOOBE;
+  tuc_params_.expected_check_result = metrics::CheckResult::kParsingError;
+  tuc_params_.expected_check_reaction = metrics::CheckReaction::kUnset;
 
   EXPECT_CALL(mock_cm, GetConnectionProperties(_, _))
       .WillRepeatedly(DoAll(SetArgPointee<0>(ConnectionType::kCellular),
@@ -1201,111 +1019,77 @@
   EXPECT_CALL(mock_cm, IsAllowedConnectionTypesForUpdateSet())
       .WillRepeatedly(Return(false));
 
-  ASSERT_FALSE(TestUpdateCheck(fake_update_response_.GetUpdateResponse(),
-                               -1,
-                               false,  // ping_only
-                               ErrorCode::kNonCriticalUpdateInOOBE,
-                               metrics::CheckResult::kParsingError,
-                               metrics::CheckReaction::kUnset,
-                               metrics::DownloadErrorCode::kUnset,
-                               &response,
-                               nullptr));
+  ASSERT_FALSE(TestUpdateCheck());
+
   EXPECT_FALSE(response.update_exists);
 }
 
 TEST_F(OmahaRequestActionTest, WallClockBasedWaitAloneCausesScattering) {
-  OmahaResponse response;
   request_params_.set_wall_clock_based_wait_enabled(true);
   request_params_.set_update_check_count_wait_enabled(false);
   request_params_.set_waiting_period(TimeDelta::FromDays(2));
-
   fake_system_state_.fake_clock()->SetWallclockTime(Time::Now());
+  tuc_params_.http_response = fake_update_response_.GetUpdateResponse();
+  tuc_params_.expected_code = ErrorCode::kOmahaUpdateDeferredPerPolicy;
+  tuc_params_.expected_check_reaction = metrics::CheckReaction::kDeferring;
 
-  ASSERT_FALSE(TestUpdateCheck(fake_update_response_.GetUpdateResponse(),
-                               -1,
-                               false,  // ping_only
-                               ErrorCode::kOmahaUpdateDeferredPerPolicy,
-                               metrics::CheckResult::kUpdateAvailable,
-                               metrics::CheckReaction::kDeferring,
-                               metrics::DownloadErrorCode::kUnset,
-                               &response,
-                               nullptr));
+  ASSERT_FALSE(TestUpdateCheck());
+
   EXPECT_FALSE(response.update_exists);
+}
+
+TEST_F(OmahaRequestActionTest,
+       WallClockBasedWaitAloneCausesScatteringInteractive) {
+  request_params_.set_wall_clock_based_wait_enabled(true);
+  request_params_.set_update_check_count_wait_enabled(false);
+  request_params_.set_waiting_period(TimeDelta::FromDays(2));
+  request_params_.set_interactive(true);
+  fake_system_state_.fake_clock()->SetWallclockTime(Time::Now());
+  tuc_params_.http_response = fake_update_response_.GetUpdateResponse();
 
   // Verify if we are interactive check we don't defer.
-  request_params_.set_interactive(true);
-  ASSERT_TRUE(TestUpdateCheck(fake_update_response_.GetUpdateResponse(),
-                              -1,
-                              false,  // ping_only
-                              ErrorCode::kSuccess,
-                              metrics::CheckResult::kUpdateAvailable,
-                              metrics::CheckReaction::kUpdating,
-                              metrics::DownloadErrorCode::kUnset,
-                              &response,
-                              nullptr));
+  ASSERT_TRUE(TestUpdateCheck());
+
   EXPECT_TRUE(response.update_exists);
 }
 
 TEST_F(OmahaRequestActionTest, NoWallClockBasedWaitCausesNoScattering) {
-  OmahaResponse response;
   request_params_.set_wall_clock_based_wait_enabled(false);
   request_params_.set_waiting_period(TimeDelta::FromDays(2));
   request_params_.set_update_check_count_wait_enabled(true);
   request_params_.set_min_update_checks_needed(1);
   request_params_.set_max_update_checks_allowed(8);
+  tuc_params_.http_response = fake_update_response_.GetUpdateResponse();
 
-  ASSERT_TRUE(TestUpdateCheck(fake_update_response_.GetUpdateResponse(),
-                              -1,
-                              false,  // ping_only
-                              ErrorCode::kSuccess,
-                              metrics::CheckResult::kUpdateAvailable,
-                              metrics::CheckReaction::kUpdating,
-                              metrics::DownloadErrorCode::kUnset,
-                              &response,
-                              nullptr));
+  ASSERT_TRUE(TestUpdateCheck());
+
   EXPECT_TRUE(response.update_exists);
 }
 
 TEST_F(OmahaRequestActionTest, ZeroMaxDaysToScatterCausesNoScattering) {
-  OmahaResponse response;
   request_params_.set_wall_clock_based_wait_enabled(true);
   request_params_.set_waiting_period(TimeDelta::FromDays(2));
   request_params_.set_update_check_count_wait_enabled(true);
   request_params_.set_min_update_checks_needed(1);
   request_params_.set_max_update_checks_allowed(8);
-
   fake_update_response_.max_days_to_scatter = "0";
-  ASSERT_TRUE(TestUpdateCheck(fake_update_response_.GetUpdateResponse(),
-                              -1,
-                              false,  // ping_only
-                              ErrorCode::kSuccess,
-                              metrics::CheckResult::kUpdateAvailable,
-                              metrics::CheckReaction::kUpdating,
-                              metrics::DownloadErrorCode::kUnset,
-                              &response,
-                              nullptr));
+  tuc_params_.http_response = fake_update_response_.GetUpdateResponse();
+
+  ASSERT_TRUE(TestUpdateCheck());
+
   EXPECT_TRUE(response.update_exists);
 }
 
 TEST_F(OmahaRequestActionTest, ZeroUpdateCheckCountCausesNoScattering) {
-  OmahaResponse response;
   request_params_.set_wall_clock_based_wait_enabled(true);
   request_params_.set_waiting_period(TimeDelta());
   request_params_.set_update_check_count_wait_enabled(true);
   request_params_.set_min_update_checks_needed(0);
   request_params_.set_max_update_checks_allowed(0);
-
   fake_system_state_.fake_clock()->SetWallclockTime(Time::Now());
+  tuc_params_.http_response = fake_update_response_.GetUpdateResponse();
 
-  ASSERT_TRUE(TestUpdateCheck(fake_update_response_.GetUpdateResponse(),
-                              -1,
-                              false,  // ping_only
-                              ErrorCode::kSuccess,
-                              metrics::CheckResult::kUpdateAvailable,
-                              metrics::CheckReaction::kUpdating,
-                              metrics::DownloadErrorCode::kUnset,
-                              &response,
-                              nullptr));
+  ASSERT_TRUE(TestUpdateCheck());
 
   int64_t count;
   ASSERT_TRUE(fake_prefs_.GetInt64(kPrefsUpdateCheckCount, &count));
@@ -1314,141 +1098,118 @@
 }
 
 TEST_F(OmahaRequestActionTest, NonZeroUpdateCheckCountCausesScattering) {
-  OmahaResponse response;
   request_params_.set_wall_clock_based_wait_enabled(true);
   request_params_.set_waiting_period(TimeDelta());
   request_params_.set_update_check_count_wait_enabled(true);
   request_params_.set_min_update_checks_needed(1);
   request_params_.set_max_update_checks_allowed(8);
-
   fake_system_state_.fake_clock()->SetWallclockTime(Time::Now());
+  tuc_params_.http_response = fake_update_response_.GetUpdateResponse();
+  tuc_params_.expected_code = ErrorCode::kOmahaUpdateDeferredPerPolicy;
+  tuc_params_.expected_check_reaction = metrics::CheckReaction::kDeferring;
 
-  ASSERT_FALSE(TestUpdateCheck(fake_update_response_.GetUpdateResponse(),
-                               -1,
-                               false,  // ping_only
-                               ErrorCode::kOmahaUpdateDeferredPerPolicy,
-                               metrics::CheckResult::kUpdateAvailable,
-                               metrics::CheckReaction::kDeferring,
-                               metrics::DownloadErrorCode::kUnset,
-                               &response,
-                               nullptr));
+  ASSERT_FALSE(TestUpdateCheck());
 
   int64_t count;
   ASSERT_TRUE(fake_prefs_.GetInt64(kPrefsUpdateCheckCount, &count));
   ASSERT_GT(count, 0);
   EXPECT_FALSE(response.update_exists);
-
-  // Verify if we are interactive check we don't defer.
-  request_params_.set_interactive(true);
-  ASSERT_TRUE(TestUpdateCheck(fake_update_response_.GetUpdateResponse(),
-                              -1,
-                              false,  // ping_only
-                              ErrorCode::kSuccess,
-                              metrics::CheckResult::kUpdateAvailable,
-                              metrics::CheckReaction::kUpdating,
-                              metrics::DownloadErrorCode::kUnset,
-                              &response,
-                              nullptr));
-  EXPECT_TRUE(response.update_exists);
 }
 
-TEST_F(OmahaRequestActionTest, ExistingUpdateCheckCountCausesScattering) {
-  OmahaResponse response;
+TEST_F(OmahaRequestActionTest,
+       NonZeroUpdateCheckCountCausesScatteringInteractive) {
   request_params_.set_wall_clock_based_wait_enabled(true);
   request_params_.set_waiting_period(TimeDelta());
   request_params_.set_update_check_count_wait_enabled(true);
   request_params_.set_min_update_checks_needed(1);
   request_params_.set_max_update_checks_allowed(8);
-
+  request_params_.set_interactive(true);
   fake_system_state_.fake_clock()->SetWallclockTime(Time::Now());
+  tuc_params_.http_response = fake_update_response_.GetUpdateResponse();
+
+  // Verify if we are interactive check we don't defer.
+  ASSERT_TRUE(TestUpdateCheck());
+
+  EXPECT_TRUE(response.update_exists);
+}
+
+TEST_F(OmahaRequestActionTest, ExistingUpdateCheckCountCausesScattering) {
+  request_params_.set_wall_clock_based_wait_enabled(true);
+  request_params_.set_waiting_period(TimeDelta());
+  request_params_.set_update_check_count_wait_enabled(true);
+  request_params_.set_min_update_checks_needed(1);
+  request_params_.set_max_update_checks_allowed(8);
+  fake_system_state_.fake_clock()->SetWallclockTime(Time::Now());
+  tuc_params_.http_response = fake_update_response_.GetUpdateResponse();
+  tuc_params_.expected_code = ErrorCode::kOmahaUpdateDeferredPerPolicy;
+  tuc_params_.expected_check_reaction = metrics::CheckReaction::kDeferring;
 
   ASSERT_TRUE(fake_prefs_.SetInt64(kPrefsUpdateCheckCount, 5));
-
-  ASSERT_FALSE(TestUpdateCheck(fake_update_response_.GetUpdateResponse(),
-                               -1,
-                               false,  // ping_only
-                               ErrorCode::kOmahaUpdateDeferredPerPolicy,
-                               metrics::CheckResult::kUpdateAvailable,
-                               metrics::CheckReaction::kDeferring,
-                               metrics::DownloadErrorCode::kUnset,
-                               &response,
-                               nullptr));
+  ASSERT_FALSE(TestUpdateCheck());
 
   int64_t count;
   ASSERT_TRUE(fake_prefs_.GetInt64(kPrefsUpdateCheckCount, &count));
-  // count remains the same, as the decrementing happens in update_attempter
+  // |count| remains the same, as the decrementing happens in update_attempter
   // which this test doesn't exercise.
   ASSERT_EQ(count, 5);
   EXPECT_FALSE(response.update_exists);
+}
+
+TEST_F(OmahaRequestActionTest,
+       ExistingUpdateCheckCountCausesScatteringInteractive) {
+  request_params_.set_wall_clock_based_wait_enabled(true);
+  request_params_.set_waiting_period(TimeDelta());
+  request_params_.set_update_check_count_wait_enabled(true);
+  request_params_.set_min_update_checks_needed(1);
+  request_params_.set_max_update_checks_allowed(8);
+  request_params_.set_interactive(true);
+  fake_system_state_.fake_clock()->SetWallclockTime(Time::Now());
+  tuc_params_.http_response = fake_update_response_.GetUpdateResponse();
+
+  ASSERT_TRUE(fake_prefs_.SetInt64(kPrefsUpdateCheckCount, 5));
 
   // Verify if we are interactive check we don't defer.
-  request_params_.set_interactive(true);
-  ASSERT_TRUE(TestUpdateCheck(fake_update_response_.GetUpdateResponse(),
-                              -1,
-                              false,  // ping_only
-                              ErrorCode::kSuccess,
-                              metrics::CheckResult::kUpdateAvailable,
-                              metrics::CheckReaction::kUpdating,
-                              metrics::DownloadErrorCode::kUnset,
-                              &response,
-                              nullptr));
+  ASSERT_TRUE(TestUpdateCheck());
   EXPECT_TRUE(response.update_exists);
 }
 
 TEST_F(OmahaRequestActionTest, StagingTurnedOnCausesScattering) {
   // If staging is on, the value for max days to scatter should be ignored, and
   // staging's scatter value should be used.
-  OmahaResponse response;
   request_params_.set_wall_clock_based_wait_enabled(true);
   request_params_.set_waiting_period(TimeDelta::FromDays(6));
   request_params_.set_update_check_count_wait_enabled(false);
-
   fake_system_state_.fake_clock()->SetWallclockTime(Time::Now());
 
   ASSERT_TRUE(fake_prefs_.SetInt64(kPrefsWallClockStagingWaitPeriod, 6));
   // This should not prevent scattering due to staging.
   fake_update_response_.max_days_to_scatter = "0";
-  ASSERT_FALSE(TestUpdateCheck(fake_update_response_.GetUpdateResponse(),
-                               -1,
-                               false,  // ping_only
-                               ErrorCode::kOmahaUpdateDeferredPerPolicy,
-                               metrics::CheckResult::kUpdateAvailable,
-                               metrics::CheckReaction::kDeferring,
-                               metrics::DownloadErrorCode::kUnset,
-                               &response,
-                               nullptr));
+  tuc_params_.http_response = fake_update_response_.GetUpdateResponse();
+  tuc_params_.expected_code = ErrorCode::kOmahaUpdateDeferredPerPolicy;
+  tuc_params_.expected_check_reaction = metrics::CheckReaction::kDeferring;
+
+  ASSERT_FALSE(TestUpdateCheck());
+
   EXPECT_FALSE(response.update_exists);
 
   // Interactive updates should not be affected.
   request_params_.set_interactive(true);
-  ASSERT_TRUE(TestUpdateCheck(fake_update_response_.GetUpdateResponse(),
-                              -1,
-                              false,  // ping_only
-                              ErrorCode::kSuccess,
-                              metrics::CheckResult::kUpdateAvailable,
-                              metrics::CheckReaction::kUpdating,
-                              metrics::DownloadErrorCode::kUnset,
-                              &response,
-                              nullptr));
+  tuc_params_.expected_code = ErrorCode::kSuccess;
+  tuc_params_.expected_check_reaction = metrics::CheckReaction::kUpdating;
+
+  ASSERT_TRUE(TestUpdateCheck());
+
   EXPECT_TRUE(response.update_exists);
 }
 
 TEST_F(OmahaRequestActionTest, CohortsArePersisted) {
-  OmahaResponse response;
   fake_update_response_.include_cohorts = true;
   fake_update_response_.cohort = "s/154454/8479665";
   fake_update_response_.cohorthint = "please-put-me-on-beta";
   fake_update_response_.cohortname = "stable";
+  tuc_params_.http_response = fake_update_response_.GetUpdateResponse();
 
-  ASSERT_TRUE(TestUpdateCheck(fake_update_response_.GetUpdateResponse(),
-                              -1,
-                              false,  // ping_only
-                              ErrorCode::kSuccess,
-                              metrics::CheckResult::kUpdateAvailable,
-                              metrics::CheckReaction::kUpdating,
-                              metrics::DownloadErrorCode::kUnset,
-                              &response,
-                              nullptr));
+  ASSERT_TRUE(TestUpdateCheck());
 
   string value;
   EXPECT_TRUE(fake_prefs_.GetString(kPrefsOmahaCohort, &value));
@@ -1462,7 +1223,6 @@
 }
 
 TEST_F(OmahaRequestActionTest, CohortsAreUpdated) {
-  OmahaResponse response;
   EXPECT_TRUE(fake_prefs_.SetString(kPrefsOmahaCohort, "old_value"));
   EXPECT_TRUE(fake_prefs_.SetString(kPrefsOmahaCohortHint, "old_hint"));
   EXPECT_TRUE(fake_prefs_.SetString(kPrefsOmahaCohortName, "old_name"));
@@ -1470,16 +1230,9 @@
   fake_update_response_.cohort = "s/154454/8479665";
   fake_update_response_.cohorthint = "please-put-me-on-beta";
   fake_update_response_.cohortname = "";
+  tuc_params_.http_response = fake_update_response_.GetUpdateResponse();
 
-  ASSERT_TRUE(TestUpdateCheck(fake_update_response_.GetUpdateResponse(),
-                              -1,
-                              false,  // ping_only
-                              ErrorCode::kSuccess,
-                              metrics::CheckResult::kUpdateAvailable,
-                              metrics::CheckReaction::kUpdating,
-                              metrics::DownloadErrorCode::kUnset,
-                              &response,
-                              nullptr));
+  ASSERT_TRUE(TestUpdateCheck());
 
   string value;
   EXPECT_TRUE(fake_prefs_.GetString(kPrefsOmahaCohort, &value));
@@ -1492,18 +1245,10 @@
 }
 
 TEST_F(OmahaRequestActionTest, CohortsAreNotModifiedWhenMissing) {
-  OmahaResponse response;
-  EXPECT_TRUE(fake_prefs_.SetString(kPrefsOmahaCohort, "old_value"));
+  tuc_params_.http_response = fake_update_response_.GetUpdateResponse();
 
-  ASSERT_TRUE(TestUpdateCheck(fake_update_response_.GetUpdateResponse(),
-                              -1,
-                              false,  // ping_only
-                              ErrorCode::kSuccess,
-                              metrics::CheckResult::kUpdateAvailable,
-                              metrics::CheckReaction::kUpdating,
-                              metrics::DownloadErrorCode::kUnset,
-                              &response,
-                              nullptr));
+  EXPECT_TRUE(fake_prefs_.SetString(kPrefsOmahaCohort, "old_value"));
+  ASSERT_TRUE(TestUpdateCheck());
 
   string value;
   EXPECT_TRUE(fake_prefs_.GetString(kPrefsOmahaCohort, &value));
@@ -1514,21 +1259,15 @@
 }
 
 TEST_F(OmahaRequestActionTest, CohortsArePersistedWhenNoUpdate) {
-  OmahaResponse response;
   fake_update_response_.include_cohorts = true;
   fake_update_response_.cohort = "s/154454/8479665";
   fake_update_response_.cohorthint = "please-put-me-on-beta";
   fake_update_response_.cohortname = "stable";
+  tuc_params_.http_response = fake_update_response_.GetNoUpdateResponse();
+  tuc_params_.expected_check_result = metrics::CheckResult::kNoUpdateAvailable;
+  tuc_params_.expected_check_reaction = metrics::CheckReaction::kUnset;
 
-  ASSERT_TRUE(TestUpdateCheck(fake_update_response_.GetNoUpdateResponse(),
-                              -1,
-                              false,  // ping_only
-                              ErrorCode::kSuccess,
-                              metrics::CheckResult::kNoUpdateAvailable,
-                              metrics::CheckReaction::kUnset,
-                              metrics::DownloadErrorCode::kUnset,
-                              &response,
-                              nullptr));
+  ASSERT_TRUE(TestUpdateCheck());
 
   string value;
   EXPECT_TRUE(fake_prefs_.GetString(kPrefsOmahaCohort, &value));
@@ -1542,22 +1281,14 @@
 }
 
 TEST_F(OmahaRequestActionTest, MultiAppCohortTest) {
-  OmahaResponse response;
   fake_update_response_.multi_app = true;
   fake_update_response_.include_cohorts = true;
   fake_update_response_.cohort = "s/154454/8479665";
   fake_update_response_.cohorthint = "please-put-me-on-beta";
   fake_update_response_.cohortname = "stable";
+  tuc_params_.http_response = fake_update_response_.GetUpdateResponse();
 
-  ASSERT_TRUE(TestUpdateCheck(fake_update_response_.GetUpdateResponse(),
-                              -1,
-                              false,  // ping_only
-                              ErrorCode::kSuccess,
-                              metrics::CheckResult::kUpdateAvailable,
-                              metrics::CheckReaction::kUpdating,
-                              metrics::DownloadErrorCode::kUnset,
-                              &response,
-                              nullptr));
+  ASSERT_TRUE(TestUpdateCheck());
 
   string value;
   EXPECT_TRUE(fake_prefs_.GetString(kPrefsOmahaCohort, &value));
@@ -1572,7 +1303,6 @@
 
 TEST_F(OmahaRequestActionTest, NoOutputPipeTest) {
   const string http_response(fake_update_response_.GetNoUpdateResponse());
-
   brillo::FakeMessageLoop loop(nullptr);
   loop.SetAsCurrent();
 
@@ -1595,92 +1325,71 @@
 }
 
 TEST_F(OmahaRequestActionTest, InvalidXmlTest) {
-  OmahaResponse response;
-  ASSERT_FALSE(TestUpdateCheck("invalid xml>",
-                               -1,
-                               false,  // ping_only
-                               ErrorCode::kOmahaRequestXMLParseError,
-                               metrics::CheckResult::kParsingError,
-                               metrics::CheckReaction::kUnset,
-                               metrics::DownloadErrorCode::kUnset,
-                               &response,
-                               nullptr));
+  tuc_params_.http_response = "invalid xml>";
+  tuc_params_.expected_code = ErrorCode::kOmahaRequestXMLParseError;
+  tuc_params_.expected_check_result = metrics::CheckResult::kParsingError;
+  tuc_params_.expected_check_reaction = metrics::CheckReaction::kUnset;
+
+  ASSERT_FALSE(TestUpdateCheck());
   EXPECT_FALSE(response.update_exists);
 }
 
 TEST_F(OmahaRequestActionTest, EmptyResponseTest) {
-  OmahaResponse response;
-  ASSERT_FALSE(TestUpdateCheck("",
-                               -1,
-                               false,  // ping_only
-                               ErrorCode::kOmahaRequestEmptyResponseError,
-                               metrics::CheckResult::kParsingError,
-                               metrics::CheckReaction::kUnset,
-                               metrics::DownloadErrorCode::kUnset,
-                               &response,
-                               nullptr));
+  tuc_params_.expected_code = ErrorCode::kOmahaRequestEmptyResponseError;
+  tuc_params_.expected_check_result = metrics::CheckResult::kParsingError;
+  tuc_params_.expected_check_reaction = metrics::CheckReaction::kUnset;
+
+  ASSERT_FALSE(TestUpdateCheck());
   EXPECT_FALSE(response.update_exists);
 }
 
 TEST_F(OmahaRequestActionTest, MissingStatusTest) {
-  OmahaResponse response;
-  ASSERT_FALSE(TestUpdateCheck(
+  tuc_params_.http_response =
       "<?xml version=\"1.0\" encoding=\"UTF-8\"?><response protocol=\"3.0\">"
       "<daystart elapsed_seconds=\"100\"/>"
       "<app appid=\"foo\" status=\"ok\">"
       "<ping status=\"ok\"/>"
-      "<updatecheck/></app></response>",
-      -1,
-      false,  // ping_only
-      ErrorCode::kOmahaResponseInvalid,
-      metrics::CheckResult::kParsingError,
-      metrics::CheckReaction::kUnset,
-      metrics::DownloadErrorCode::kUnset,
-      &response,
-      nullptr));
+      "<updatecheck/></app></response>";
+  tuc_params_.expected_code = ErrorCode::kOmahaResponseInvalid;
+  tuc_params_.expected_check_result = metrics::CheckResult::kParsingError;
+  tuc_params_.expected_check_reaction = metrics::CheckReaction::kUnset;
+
+  ASSERT_FALSE(TestUpdateCheck());
   EXPECT_FALSE(response.update_exists);
 }
 
 TEST_F(OmahaRequestActionTest, InvalidStatusTest) {
-  OmahaResponse response;
-  ASSERT_FALSE(TestUpdateCheck(
+  tuc_params_.http_response =
       "<?xml version=\"1.0\" encoding=\"UTF-8\"?><response protocol=\"3.0\">"
       "<daystart elapsed_seconds=\"100\"/>"
       "<app appid=\"foo\" status=\"ok\">"
       "<ping status=\"ok\"/>"
-      "<updatecheck status=\"InvalidStatusTest\"/></app></response>",
-      -1,
-      false,  // ping_only
-      ErrorCode::kOmahaResponseInvalid,
-      metrics::CheckResult::kParsingError,
-      metrics::CheckReaction::kUnset,
-      metrics::DownloadErrorCode::kUnset,
-      &response,
-      nullptr));
+      "<updatecheck status=\"InvalidStatusTest\"/></app></response>";
+  tuc_params_.expected_code = ErrorCode::kOmahaResponseInvalid;
+  tuc_params_.expected_check_result = metrics::CheckResult::kParsingError;
+  tuc_params_.expected_check_reaction = metrics::CheckReaction::kUnset;
+
+  ASSERT_FALSE(TestUpdateCheck());
   EXPECT_FALSE(response.update_exists);
 }
 
 TEST_F(OmahaRequestActionTest, MissingNodesetTest) {
-  OmahaResponse response;
-  ASSERT_FALSE(TestUpdateCheck(
+  tuc_params_.http_response =
       "<?xml version=\"1.0\" encoding=\"UTF-8\"?><response protocol=\"3.0\">"
       "<daystart elapsed_seconds=\"100\"/>"
       "<app appid=\"foo\" status=\"ok\">"
       "<ping status=\"ok\"/>"
-      "</app></response>",
-      -1,
-      false,  // ping_only
-      ErrorCode::kOmahaResponseInvalid,
-      metrics::CheckResult::kParsingError,
-      metrics::CheckReaction::kUnset,
-      metrics::DownloadErrorCode::kUnset,
-      &response,
-      nullptr));
+      "</app></response>";
+  tuc_params_.expected_code = ErrorCode::kOmahaResponseInvalid;
+  tuc_params_.expected_check_result = metrics::CheckResult::kParsingError;
+  tuc_params_.expected_check_reaction = metrics::CheckReaction::kUnset;
+
+  ASSERT_FALSE(TestUpdateCheck());
   EXPECT_FALSE(response.update_exists);
 }
 
 TEST_F(OmahaRequestActionTest, MissingFieldTest) {
-  string input_response =
+  tuc_params_.http_response =
       "<?xml version=\"1.0\" encoding=\"UTF-8\"?><response protocol=\"3.0\">"
       "<daystart elapsed_seconds=\"100\"/>"
       // the appid needs to match that in the request params
@@ -1697,18 +1406,9 @@
       "IsDeltaPayload=\"false\" "
       "sha256=\"not-used\" "
       "/></actions></manifest></updatecheck></app></response>";
-  LOG(INFO) << "Input Response = " << input_response;
 
-  OmahaResponse response;
-  ASSERT_TRUE(TestUpdateCheck(input_response,
-                              -1,
-                              false,  // ping_only
-                              ErrorCode::kSuccess,
-                              metrics::CheckResult::kUpdateAvailable,
-                              metrics::CheckReaction::kUpdating,
-                              metrics::DownloadErrorCode::kUnset,
-                              &response,
-                              nullptr));
+  ASSERT_TRUE(TestUpdateCheck());
+
   EXPECT_TRUE(response.update_exists);
   EXPECT_EQ("10.2.3.4", response.version);
   EXPECT_EQ("http://missing/field/test/f",
@@ -1757,9 +1457,7 @@
 }
 
 TEST_F(OmahaRequestActionTest, XmlEncodeIsUsedForParams) {
-  brillo::Blob post_data;
-
-  // Make sure XML Encode is being called on the params
+  // Make sure XML Encode is being called on the params.
   request_params_.set_os_sp("testtheservice_pack>");
   request_params_.set_os_board("x86 generic<id");
   request_params_.set_current_channel("unittest_track&lt;");
@@ -1770,18 +1468,13 @@
   fake_prefs_.SetString(
       kPrefsOmahaCohortName,
       base::JoinString(vector<string>(100, "My spoon is too big."), " "));
-  OmahaResponse response;
-  ASSERT_FALSE(TestUpdateCheck("invalid xml>",
-                               -1,
-                               false,  // ping_only
-                               ErrorCode::kOmahaRequestXMLParseError,
-                               metrics::CheckResult::kParsingError,
-                               metrics::CheckReaction::kUnset,
-                               metrics::DownloadErrorCode::kUnset,
-                               &response,
-                               &post_data));
-  // convert post_data to string
-  string post_str(post_data.begin(), post_data.end());
+  tuc_params_.http_response = "invalid xml>";
+  tuc_params_.expected_code = ErrorCode::kOmahaRequestXMLParseError;
+  tuc_params_.expected_check_result = metrics::CheckResult::kParsingError;
+  tuc_params_.expected_check_reaction = metrics::CheckReaction::kUnset;
+
+  ASSERT_FALSE(TestUpdateCheck());
+
   EXPECT_NE(string::npos, post_str.find("testtheservice_pack&gt;"));
   EXPECT_EQ(string::npos, post_str.find("testtheservice_pack>"));
   EXPECT_NE(string::npos, post_str.find("x86 generic&lt;id"));
@@ -1799,19 +1492,12 @@
 }
 
 TEST_F(OmahaRequestActionTest, XmlDecodeTest) {
-  OmahaResponse response;
   fake_update_response_.deadline = "&lt;20110101";
   fake_update_response_.more_info_url = "testthe&lt;url";
   fake_update_response_.codebase = "testthe&amp;codebase/";
-  ASSERT_TRUE(TestUpdateCheck(fake_update_response_.GetUpdateResponse(),
-                              -1,
-                              false,  // ping_only
-                              ErrorCode::kSuccess,
-                              metrics::CheckResult::kUpdateAvailable,
-                              metrics::CheckReaction::kUpdating,
-                              metrics::DownloadErrorCode::kUnset,
-                              &response,
-                              nullptr));
+  tuc_params_.http_response = fake_update_response_.GetUpdateResponse();
+
+  ASSERT_TRUE(TestUpdateCheck());
 
   EXPECT_EQ("testthe<url", response.more_info_url);
   EXPECT_EQ("testthe&codebase/file.signed",
@@ -1820,43 +1506,29 @@
 }
 
 TEST_F(OmahaRequestActionTest, ParseIntTest) {
-  OmahaResponse response;
   // overflows int32_t:
   fake_update_response_.size = 123123123123123ull;
-  ASSERT_TRUE(TestUpdateCheck(fake_update_response_.GetUpdateResponse(),
-                              -1,
-                              false,  // ping_only
-                              ErrorCode::kSuccess,
-                              metrics::CheckResult::kUpdateAvailable,
-                              metrics::CheckReaction::kUpdating,
-                              metrics::DownloadErrorCode::kUnset,
-                              &response,
-                              nullptr));
+  tuc_params_.http_response = fake_update_response_.GetUpdateResponse();
 
+  ASSERT_TRUE(TestUpdateCheck());
   EXPECT_EQ(fake_update_response_.size, response.packages[0].size);
 }
 
 TEST_F(OmahaRequestActionTest, FormatUpdateCheckOutputTest) {
-  brillo::Blob post_data;
   NiceMock<MockPrefs> prefs;
   fake_system_state_.set_prefs(&prefs);
+  tuc_params_.http_response = "invalid xml>";
+  tuc_params_.expected_code = ErrorCode::kOmahaRequestXMLParseError;
+  tuc_params_.expected_check_result = metrics::CheckResult::kParsingError;
+  tuc_params_.expected_check_reaction = metrics::CheckReaction::kUnset;
 
   EXPECT_CALL(prefs, GetString(kPrefsPreviousVersion, _))
       .WillOnce(DoAll(SetArgPointee<1>(string("")), Return(true)));
   // An existing but empty previous version means that we didn't reboot to a new
   // update, therefore, no need to update the previous version.
   EXPECT_CALL(prefs, SetString(kPrefsPreviousVersion, _)).Times(0);
-  ASSERT_FALSE(TestUpdateCheck("invalid xml>",
-                               -1,
-                               false,  // ping_only
-                               ErrorCode::kOmahaRequestXMLParseError,
-                               metrics::CheckResult::kParsingError,
-                               metrics::CheckReaction::kUnset,
-                               metrics::DownloadErrorCode::kUnset,
-                               nullptr,  // response
-                               &post_data));
-  // convert post_data to string
-  string post_str(post_data.begin(), post_data.end());
+  ASSERT_FALSE(TestUpdateCheck());
+
   EXPECT_NE(
       post_str.find("        <ping active=\"1\" a=\"-1\" r=\"-1\"></ping>\n"
                     "        <updatecheck></updatecheck>\n"),
@@ -1870,12 +1542,9 @@
 }
 
 TEST_F(OmahaRequestActionTest, FormatSuccessEventOutputTest) {
-  brillo::Blob post_data;
   TestEvent(new OmahaEvent(OmahaEvent::kTypeUpdateDownloadStarted),
-            "invalid xml>",
-            &post_data);
-  // convert post_data to string
-  string post_str(post_data.begin(), post_data.end());
+            "invalid xml>");
+
   string expected_event = base::StringPrintf(
       "        <event eventtype=\"%d\" eventresult=\"%d\"></event>\n",
       OmahaEvent::kTypeUpdateDownloadStarted,
@@ -1886,14 +1555,11 @@
 }
 
 TEST_F(OmahaRequestActionTest, FormatErrorEventOutputTest) {
-  brillo::Blob post_data;
   TestEvent(new OmahaEvent(OmahaEvent::kTypeDownloadComplete,
                            OmahaEvent::kResultError,
                            ErrorCode::kError),
-            "invalid xml>",
-            &post_data);
-  // convert post_data to string
-  string post_str(post_data.begin(), post_data.end());
+            "invalid xml>");
+
   string expected_event = base::StringPrintf(
       "        <event eventtype=\"%d\" eventresult=\"%d\" "
       "errorcode=\"%d\"></event>\n",
@@ -1924,24 +1590,17 @@
 }
 
 TEST_F(OmahaRequestActionTest, FormatDeltaOkayOutputTest) {
+  tuc_params_.http_response = "invalid xml>";
+  tuc_params_.expected_code = ErrorCode::kOmahaRequestXMLParseError;
+  tuc_params_.expected_check_result = metrics::CheckResult::kParsingError;
+  tuc_params_.expected_check_reaction = metrics::CheckReaction::kUnset;
+
   for (int i = 0; i < 2; i++) {
     bool delta_okay = i == 1;
     const char* delta_okay_str = delta_okay ? "true" : "false";
-    brillo::Blob post_data;
-
     request_params_.set_delta_okay(delta_okay);
 
-    ASSERT_FALSE(TestUpdateCheck("invalid xml>",
-                                 -1,
-                                 false,  // ping_only
-                                 ErrorCode::kOmahaRequestXMLParseError,
-                                 metrics::CheckResult::kParsingError,
-                                 metrics::CheckReaction::kUnset,
-                                 metrics::DownloadErrorCode::kUnset,
-                                 nullptr,
-                                 &post_data));
-    // convert post_data to string
-    string post_str(post_data.begin(), post_data.end());
+    ASSERT_FALSE(TestUpdateCheck());
     EXPECT_NE(
         post_str.find(base::StringPrintf(" delta_okay=\"%s\"", delta_okay_str)),
         string::npos)
@@ -1950,25 +1609,17 @@
 }
 
 TEST_F(OmahaRequestActionTest, FormatInteractiveOutputTest) {
+  tuc_params_.http_response = "invalid xml>";
+  tuc_params_.expected_code = ErrorCode::kOmahaRequestXMLParseError;
+  tuc_params_.expected_check_result = metrics::CheckResult::kParsingError;
+  tuc_params_.expected_check_reaction = metrics::CheckReaction::kUnset;
+
   for (int i = 0; i < 2; i++) {
     bool interactive = i == 1;
     const char* interactive_str = interactive ? "ondemandupdate" : "scheduler";
-    brillo::Blob post_data;
-    FakeSystemState fake_system_state;
-
     request_params_.set_interactive(interactive);
 
-    ASSERT_FALSE(TestUpdateCheck("invalid xml>",
-                                 -1,
-                                 false,  // ping_only
-                                 ErrorCode::kOmahaRequestXMLParseError,
-                                 metrics::CheckResult::kParsingError,
-                                 metrics::CheckReaction::kUnset,
-                                 metrics::DownloadErrorCode::kUnset,
-                                 nullptr,
-                                 &post_data));
-    // convert post_data to string
-    string post_str(post_data.begin(), post_data.end());
+    ASSERT_FALSE(TestUpdateCheck());
     EXPECT_NE(post_str.find(
                   base::StringPrintf("installsource=\"%s\"", interactive_str)),
               string::npos)
@@ -1977,25 +1628,17 @@
 }
 
 TEST_F(OmahaRequestActionTest, FormatTargetVersionPrefixOutputTest) {
+  tuc_params_.http_response = "invalid xml>";
+  tuc_params_.expected_code = ErrorCode::kOmahaRequestXMLParseError;
+  tuc_params_.expected_check_result = metrics::CheckResult::kParsingError;
+  tuc_params_.expected_check_reaction = metrics::CheckReaction::kUnset;
+
   for (int i = 0; i < 2; i++) {
     bool target_version_set = i == 1;
     const char* target_version_prefix = target_version_set ? "10032." : "";
-    brillo::Blob post_data;
-    FakeSystemState fake_system_state;
-
     request_params_.set_target_version_prefix(target_version_prefix);
 
-    ASSERT_FALSE(TestUpdateCheck("invalid xml>",
-                                 -1,
-                                 false,  // ping_only
-                                 ErrorCode::kOmahaRequestXMLParseError,
-                                 metrics::CheckResult::kParsingError,
-                                 metrics::CheckReaction::kUnset,
-                                 metrics::DownloadErrorCode::kUnset,
-                                 nullptr,
-                                 &post_data));
-    // convert post_data to string
-    string post_str(post_data.begin(), post_data.end());
+    ASSERT_FALSE(TestUpdateCheck());
     if (target_version_set) {
       EXPECT_NE(post_str.find("<updatecheck targetversionprefix=\"10032.\">"),
                 string::npos)
@@ -2008,27 +1651,19 @@
 }
 
 TEST_F(OmahaRequestActionTest, FormatRollbackAllowedOutputTest) {
+  tuc_params_.http_response = "invalid xml>";
+  tuc_params_.expected_code = ErrorCode::kOmahaRequestXMLParseError;
+  tuc_params_.expected_check_result = metrics::CheckResult::kParsingError;
+  tuc_params_.expected_check_reaction = metrics::CheckReaction::kUnset;
+
   for (int i = 0; i < 4; i++) {
     bool rollback_allowed = i / 2 == 0;
     bool target_version_set = i % 2 == 0;
-    brillo::Blob post_data;
-    FakeSystemState fake_system_state;
-
     request_params_.set_target_version_prefix(target_version_set ? "10032."
                                                                  : "");
     request_params_.set_rollback_allowed(rollback_allowed);
 
-    ASSERT_FALSE(TestUpdateCheck("invalid xml>",
-                                 -1,
-                                 false,  // ping_only
-                                 ErrorCode::kOmahaRequestXMLParseError,
-                                 metrics::CheckResult::kParsingError,
-                                 metrics::CheckReaction::kUnset,
-                                 metrics::DownloadErrorCode::kUnset,
-                                 nullptr,
-                                 &post_data));
-    // convert post_data to string
-    string post_str(post_data.begin(), post_data.end());
+    ASSERT_FALSE(TestUpdateCheck());
     if (rollback_allowed && target_version_set) {
       EXPECT_NE(post_str.find("rollback_allowed=\"true\""), string::npos)
           << "i = " << i;
@@ -2074,17 +1709,14 @@
       .WillOnce(DoAll(SetArgPointee<1>(six_days_ago), Return(true)));
   EXPECT_CALL(prefs, GetInt64(kPrefsLastRollCallPingDay, _))
       .WillOnce(DoAll(SetArgPointee<1>(five_days_ago), Return(true)));
-  brillo::Blob post_data;
-  ASSERT_TRUE(TestUpdateCheck(fake_update_response_.GetNoUpdateResponse(),
-                              -1,
-                              ping_only,
-                              ErrorCode::kSuccess,
-                              metrics::CheckResult::kNoUpdateAvailable,
-                              metrics::CheckReaction::kUnset,
-                              metrics::DownloadErrorCode::kUnset,
-                              nullptr,
-                              &post_data));
-  string post_str(post_data.begin(), post_data.end());
+
+  tuc_params_.http_response = fake_update_response_.GetNoUpdateResponse();
+  tuc_params_.ping_only = ping_only;
+  tuc_params_.expected_check_result = metrics::CheckResult::kNoUpdateAvailable;
+  tuc_params_.expected_check_reaction = metrics::CheckReaction::kUnset;
+
+  ASSERT_TRUE(TestUpdateCheck());
+
   EXPECT_NE(post_str.find("<ping active=\"1\" a=\"6\" r=\"5\"></ping>"),
             string::npos);
   if (ping_only) {
@@ -2119,17 +1751,13 @@
       .WillOnce(DoAll(SetArgPointee<1>(three_days_ago), Return(true)));
   EXPECT_CALL(prefs, GetInt64(kPrefsLastRollCallPingDay, _))
       .WillOnce(DoAll(SetArgPointee<1>(now), Return(true)));
-  brillo::Blob post_data;
-  ASSERT_TRUE(TestUpdateCheck(fake_update_response_.GetNoUpdateResponse(),
-                              -1,
-                              false,  // ping_only
-                              ErrorCode::kSuccess,
-                              metrics::CheckResult::kNoUpdateAvailable,
-                              metrics::CheckReaction::kUnset,
-                              metrics::DownloadErrorCode::kUnset,
-                              nullptr,
-                              &post_data));
-  string post_str(post_data.begin(), post_data.end());
+
+  tuc_params_.http_response = fake_update_response_.GetNoUpdateResponse();
+  tuc_params_.expected_check_result = metrics::CheckResult::kNoUpdateAvailable;
+  tuc_params_.expected_check_reaction = metrics::CheckReaction::kUnset;
+
+  ASSERT_TRUE(TestUpdateCheck());
+
   EXPECT_NE(post_str.find("<ping active=\"1\" a=\"3\"></ping>"), string::npos);
 }
 
@@ -2148,17 +1776,13 @@
       .WillOnce(DoAll(SetArgPointee<1>(now), Return(true)));
   EXPECT_CALL(prefs, GetInt64(kPrefsLastRollCallPingDay, _))
       .WillOnce(DoAll(SetArgPointee<1>(four_days_ago), Return(true)));
-  brillo::Blob post_data;
-  ASSERT_TRUE(TestUpdateCheck(fake_update_response_.GetNoUpdateResponse(),
-                              -1,
-                              false,  // ping_only
-                              ErrorCode::kSuccess,
-                              metrics::CheckResult::kNoUpdateAvailable,
-                              metrics::CheckReaction::kUnset,
-                              metrics::DownloadErrorCode::kUnset,
-                              nullptr,
-                              &post_data));
-  string post_str(post_data.begin(), post_data.end());
+
+  tuc_params_.http_response = fake_update_response_.GetNoUpdateResponse();
+  tuc_params_.expected_check_result = metrics::CheckResult::kNoUpdateAvailable;
+  tuc_params_.expected_check_reaction = metrics::CheckReaction::kUnset;
+
+  ASSERT_TRUE(TestUpdateCheck());
+
   EXPECT_NE(post_str.find("<ping active=\"1\" r=\"4\"></ping>\n"),
             string::npos);
 }
@@ -2183,17 +1807,13 @@
       .WillOnce(Return(true));
   EXPECT_CALL(prefs, SetInt64(kPrefsLastRollCallPingDay, _))
       .WillOnce(Return(true));
-  brillo::Blob post_data;
-  ASSERT_TRUE(TestUpdateCheck(fake_update_response_.GetNoUpdateResponse(),
-                              -1,
-                              false,  // ping_only
-                              ErrorCode::kSuccess,
-                              metrics::CheckResult::kNoUpdateAvailable,
-                              metrics::CheckReaction::kUnset,
-                              metrics::DownloadErrorCode::kUnset,
-                              nullptr,
-                              &post_data));
-  string post_str(post_data.begin(), post_data.end());
+
+  tuc_params_.http_response = fake_update_response_.GetNoUpdateResponse();
+  tuc_params_.expected_check_result = metrics::CheckResult::kNoUpdateAvailable;
+  tuc_params_.expected_check_reaction = metrics::CheckReaction::kUnset;
+
+  ASSERT_TRUE(TestUpdateCheck());
+
   EXPECT_EQ(post_str.find("ping"), string::npos);
 }
 
@@ -2208,17 +1828,14 @@
       .WillOnce(DoAll(SetArgPointee<1>(now), Return(true)));
   EXPECT_CALL(prefs, SetInt64(kPrefsLastActivePingDay, _)).Times(0);
   EXPECT_CALL(prefs, SetInt64(kPrefsLastRollCallPingDay, _)).Times(0);
-  brillo::Blob post_data;
-  EXPECT_TRUE(TestUpdateCheck(fake_update_response_.GetNoUpdateResponse(),
-                              -1,
-                              true,  // ping_only
-                              ErrorCode::kSuccess,
-                              metrics::CheckResult::kUnset,
-                              metrics::CheckReaction::kUnset,
-                              metrics::DownloadErrorCode::kUnset,
-                              nullptr,
-                              &post_data));
-  EXPECT_EQ(0U, post_data.size());
+
+  tuc_params_.http_response = fake_update_response_.GetNoUpdateResponse();
+  tuc_params_.ping_only = true;
+  tuc_params_.expected_check_result = metrics::CheckResult::kUnset;
+  tuc_params_.expected_check_reaction = metrics::CheckReaction::kUnset;
+
+  EXPECT_TRUE(TestUpdateCheck());
+  EXPECT_TRUE(post_str.empty());
 }
 
 TEST_F(OmahaRequestActionTest, BackInTimePingTest) {
@@ -2239,21 +1856,16 @@
       .WillOnce(Return(true));
   EXPECT_CALL(prefs, SetInt64(kPrefsLastRollCallPingDay, _))
       .WillOnce(Return(true));
-  brillo::Blob post_data;
-  ASSERT_TRUE(
-      TestUpdateCheck("<?xml version=\"1.0\" encoding=\"UTF-8\"?><response "
-                      "protocol=\"3.0\"><daystart elapsed_seconds=\"100\"/>"
-                      "<app appid=\"foo\" status=\"ok\"><ping status=\"ok\"/>"
-                      "<updatecheck status=\"noupdate\"/></app></response>",
-                      -1,
-                      false,  // ping_only
-                      ErrorCode::kSuccess,
-                      metrics::CheckResult::kNoUpdateAvailable,
-                      metrics::CheckReaction::kUnset,
-                      metrics::DownloadErrorCode::kUnset,
-                      nullptr,
-                      &post_data));
-  string post_str(post_data.begin(), post_data.end());
+
+  tuc_params_.http_response =
+      "<?xml version=\"1.0\" encoding=\"UTF-8\"?><response "
+      "protocol=\"3.0\"><daystart elapsed_seconds=\"100\"/>"
+      "<app appid=\"foo\" status=\"ok\"><ping status=\"ok\"/>"
+      "<updatecheck status=\"noupdate\"/></app></response>";
+  tuc_params_.expected_check_result = metrics::CheckResult::kNoUpdateAvailable;
+  tuc_params_.expected_check_reaction = metrics::CheckReaction::kUnset;
+
+  ASSERT_TRUE(TestUpdateCheck());
   EXPECT_EQ(post_str.find("ping"), string::npos);
 }
 
@@ -2278,19 +1890,16 @@
               SetInt64(kPrefsLastRollCallPingDay,
                        AllOf(Ge(midnight), Le(midnight_slack))))
       .WillOnce(Return(true));
-  ASSERT_TRUE(
-      TestUpdateCheck("<?xml version=\"1.0\" encoding=\"UTF-8\"?><response "
-                      "protocol=\"3.0\"><daystart elapsed_seconds=\"200\"/>"
-                      "<app appid=\"foo\" status=\"ok\"><ping status=\"ok\"/>"
-                      "<updatecheck status=\"noupdate\"/></app></response>",
-                      -1,
-                      false,  // ping_only
-                      ErrorCode::kSuccess,
-                      metrics::CheckResult::kNoUpdateAvailable,
-                      metrics::CheckReaction::kUnset,
-                      metrics::DownloadErrorCode::kUnset,
-                      nullptr,
-                      nullptr));
+
+  tuc_params_.http_response =
+      "<?xml version=\"1.0\" encoding=\"UTF-8\"?><response "
+      "protocol=\"3.0\"><daystart elapsed_seconds=\"200\"/>"
+      "<app appid=\"foo\" status=\"ok\"><ping status=\"ok\"/>"
+      "<updatecheck status=\"noupdate\"/></app></response>";
+  tuc_params_.expected_check_result = metrics::CheckResult::kNoUpdateAvailable;
+  tuc_params_.expected_check_reaction = metrics::CheckReaction::kUnset;
+
+  ASSERT_TRUE(TestUpdateCheck());
 }
 
 TEST_F(OmahaRequestActionTest, NoElapsedSecondsTest) {
@@ -2300,19 +1909,16 @@
   EXPECT_CALL(prefs, SetInt64(_, _)).Times(AnyNumber());
   EXPECT_CALL(prefs, SetInt64(kPrefsLastActivePingDay, _)).Times(0);
   EXPECT_CALL(prefs, SetInt64(kPrefsLastRollCallPingDay, _)).Times(0);
-  ASSERT_TRUE(
-      TestUpdateCheck("<?xml version=\"1.0\" encoding=\"UTF-8\"?><response "
-                      "protocol=\"3.0\"><daystart blah=\"200\"/>"
-                      "<app appid=\"foo\" status=\"ok\"><ping status=\"ok\"/>"
-                      "<updatecheck status=\"noupdate\"/></app></response>",
-                      -1,
-                      false,  // ping_only
-                      ErrorCode::kSuccess,
-                      metrics::CheckResult::kNoUpdateAvailable,
-                      metrics::CheckReaction::kUnset,
-                      metrics::DownloadErrorCode::kUnset,
-                      nullptr,
-                      nullptr));
+
+  tuc_params_.http_response =
+      "<?xml version=\"1.0\" encoding=\"UTF-8\"?><response "
+      "protocol=\"3.0\"><daystart blah=\"200\"/>"
+      "<app appid=\"foo\" status=\"ok\"><ping status=\"ok\"/>"
+      "<updatecheck status=\"noupdate\"/></app></response>";
+  tuc_params_.expected_check_result = metrics::CheckResult::kNoUpdateAvailable;
+  tuc_params_.expected_check_reaction = metrics::CheckReaction::kUnset;
+
+  ASSERT_TRUE(TestUpdateCheck());
 }
 
 TEST_F(OmahaRequestActionTest, BadElapsedSecondsTest) {
@@ -2322,38 +1928,31 @@
   EXPECT_CALL(prefs, SetInt64(_, _)).Times(AnyNumber());
   EXPECT_CALL(prefs, SetInt64(kPrefsLastActivePingDay, _)).Times(0);
   EXPECT_CALL(prefs, SetInt64(kPrefsLastRollCallPingDay, _)).Times(0);
-  ASSERT_TRUE(
-      TestUpdateCheck("<?xml version=\"1.0\" encoding=\"UTF-8\"?><response "
-                      "protocol=\"3.0\"><daystart elapsed_seconds=\"x\"/>"
-                      "<app appid=\"foo\" status=\"ok\"><ping status=\"ok\"/>"
-                      "<updatecheck status=\"noupdate\"/></app></response>",
-                      -1,
-                      false,  // ping_only
-                      ErrorCode::kSuccess,
-                      metrics::CheckResult::kNoUpdateAvailable,
-                      metrics::CheckReaction::kUnset,
-                      metrics::DownloadErrorCode::kUnset,
-                      nullptr,
-                      nullptr));
+
+  tuc_params_.http_response =
+      "<?xml version=\"1.0\" encoding=\"UTF-8\"?><response "
+      "protocol=\"3.0\"><daystart elapsed_seconds=\"x\"/>"
+      "<app appid=\"foo\" status=\"ok\"><ping status=\"ok\"/>"
+      "<updatecheck status=\"noupdate\"/></app></response>";
+  tuc_params_.expected_check_result = metrics::CheckResult::kNoUpdateAvailable;
+  tuc_params_.expected_check_reaction = metrics::CheckReaction::kUnset;
+
+  ASSERT_TRUE(TestUpdateCheck());
 }
 
 TEST_F(OmahaRequestActionTest, ParseUpdateCheckAttributesTest) {
   // Test that the "eol" flags is only parsed from the "_eol" attribute and not
   // the "eol" attribute.
-  ASSERT_TRUE(
-      TestUpdateCheck("<?xml version=\"1.0\" encoding=\"UTF-8\"?><response "
-                      "protocol=\"3.0\"><app appid=\"foo\" status=\"ok\">"
-                      "<ping status=\"ok\"/><updatecheck status=\"noupdate\" "
-                      "_eol=\"security-only\" eol=\"eol\" _foo=\"bar\"/>"
-                      "</app></response>",
-                      -1,
-                      false,  // ping_only
-                      ErrorCode::kSuccess,
-                      metrics::CheckResult::kNoUpdateAvailable,
-                      metrics::CheckReaction::kUnset,
-                      metrics::DownloadErrorCode::kUnset,
-                      nullptr,
-                      nullptr));
+  tuc_params_.http_response =
+      "<?xml version=\"1.0\" encoding=\"UTF-8\"?><response "
+      "protocol=\"3.0\"><app appid=\"foo\" status=\"ok\">"
+      "<ping status=\"ok\"/><updatecheck status=\"noupdate\" "
+      "_eol=\"security-only\" eol=\"eol\" _foo=\"bar\"/></app></response>";
+  tuc_params_.expected_check_result = metrics::CheckResult::kNoUpdateAvailable;
+  tuc_params_.expected_check_reaction = metrics::CheckReaction::kUnset;
+
+  ASSERT_TRUE(TestUpdateCheck());
+
   string eol_pref;
   EXPECT_TRUE(
       fake_system_state_.prefs()->GetString(kPrefsOmahaEolStatus, &eol_pref));
@@ -2363,56 +1962,48 @@
 }
 
 TEST_F(OmahaRequestActionTest, NoUniqueIDTest) {
-  brillo::Blob post_data;
-  ASSERT_FALSE(TestUpdateCheck("invalid xml>",
-                               -1,
-                               false,  // ping_only
-                               ErrorCode::kOmahaRequestXMLParseError,
-                               metrics::CheckResult::kParsingError,
-                               metrics::CheckReaction::kUnset,
-                               metrics::DownloadErrorCode::kUnset,
-                               nullptr,  // response
-                               &post_data));
-  // convert post_data to string
-  string post_str(post_data.begin(), post_data.end());
+  tuc_params_.http_response = "invalid xml>";
+  tuc_params_.expected_code = ErrorCode::kOmahaRequestXMLParseError;
+  tuc_params_.expected_check_result = metrics::CheckResult::kParsingError;
+  tuc_params_.expected_check_reaction = metrics::CheckReaction::kUnset;
+
+  ASSERT_FALSE(TestUpdateCheck());
+
   EXPECT_EQ(post_str.find("machineid="), string::npos);
   EXPECT_EQ(post_str.find("userid="), string::npos);
 }
 
 TEST_F(OmahaRequestActionTest, NetworkFailureTest) {
-  OmahaResponse response;
   const int http_error_code =
       static_cast<int>(ErrorCode::kOmahaRequestHTTPResponseBase) + 501;
-  ASSERT_FALSE(TestUpdateCheck("",
-                               501,
-                               false,  // ping_only
-                               static_cast<ErrorCode>(http_error_code),
-                               metrics::CheckResult::kDownloadError,
-                               metrics::CheckReaction::kUnset,
-                               static_cast<metrics::DownloadErrorCode>(501),
-                               &response,
-                               nullptr));
+  tuc_params_.fail_http_response_code = 501;
+  tuc_params_.expected_code = static_cast<ErrorCode>(http_error_code);
+  tuc_params_.expected_check_result = metrics::CheckResult::kDownloadError;
+  tuc_params_.expected_check_reaction = metrics::CheckReaction::kUnset;
+  tuc_params_.expected_download_error_code =
+      static_cast<metrics::DownloadErrorCode>(501);
+
+  ASSERT_FALSE(TestUpdateCheck());
+
   EXPECT_FALSE(response.update_exists);
 }
 
 TEST_F(OmahaRequestActionTest, NetworkFailureBadHTTPCodeTest) {
-  OmahaResponse response;
   const int http_error_code =
       static_cast<int>(ErrorCode::kOmahaRequestHTTPResponseBase) + 999;
-  ASSERT_FALSE(TestUpdateCheck("",
-                               1500,
-                               false,  // ping_only
-                               static_cast<ErrorCode>(http_error_code),
-                               metrics::CheckResult::kDownloadError,
-                               metrics::CheckReaction::kUnset,
-                               metrics::DownloadErrorCode::kHttpStatusOther,
-                               &response,
-                               nullptr));
+
+  tuc_params_.fail_http_response_code = 1500;
+  tuc_params_.expected_code = static_cast<ErrorCode>(http_error_code);
+  tuc_params_.expected_check_result = metrics::CheckResult::kDownloadError;
+  tuc_params_.expected_check_reaction = metrics::CheckReaction::kUnset;
+  tuc_params_.expected_download_error_code =
+      metrics::DownloadErrorCode::kHttpStatusOther;
+
+  ASSERT_FALSE(TestUpdateCheck());
   EXPECT_FALSE(response.update_exists);
 }
 
 TEST_F(OmahaRequestActionTest, TestUpdateFirstSeenAtGetsPersistedFirstTime) {
-  OmahaResponse response;
   request_params_.set_wall_clock_based_wait_enabled(true);
   request_params_.set_waiting_period(TimeDelta().FromDays(1));
   request_params_.set_update_check_count_wait_enabled(false);
@@ -2420,15 +2011,12 @@
   Time arbitrary_date;
   ASSERT_TRUE(Time::FromString("6/4/1989", &arbitrary_date));
   fake_system_state_.fake_clock()->SetWallclockTime(arbitrary_date);
-  ASSERT_FALSE(TestUpdateCheck(fake_update_response_.GetUpdateResponse(),
-                               -1,
-                               false,  // ping_only
-                               ErrorCode::kOmahaUpdateDeferredPerPolicy,
-                               metrics::CheckResult::kUpdateAvailable,
-                               metrics::CheckReaction::kDeferring,
-                               metrics::DownloadErrorCode::kUnset,
-                               &response,
-                               nullptr));
+
+  tuc_params_.http_response = fake_update_response_.GetUpdateResponse();
+  tuc_params_.expected_code = ErrorCode::kOmahaUpdateDeferredPerPolicy;
+  tuc_params_.expected_check_reaction = metrics::CheckReaction::kDeferring;
+
+  ASSERT_FALSE(TestUpdateCheck());
 
   int64_t timestamp = 0;
   ASSERT_TRUE(fake_prefs_.GetInt64(kPrefsUpdateFirstSeenAt, &timestamp));
@@ -2437,20 +2025,14 @@
 
   // Verify if we are interactive check we don't defer.
   request_params_.set_interactive(true);
-  ASSERT_TRUE(TestUpdateCheck(fake_update_response_.GetUpdateResponse(),
-                              -1,
-                              false,  // ping_only
-                              ErrorCode::kSuccess,
-                              metrics::CheckResult::kUpdateAvailable,
-                              metrics::CheckReaction::kUpdating,
-                              metrics::DownloadErrorCode::kUnset,
-                              &response,
-                              nullptr));
+  tuc_params_.expected_code = ErrorCode::kSuccess;
+  tuc_params_.expected_check_reaction = metrics::CheckReaction::kUpdating;
+
+  ASSERT_TRUE(TestUpdateCheck());
   EXPECT_TRUE(response.update_exists);
 }
 
 TEST_F(OmahaRequestActionTest, TestUpdateFirstSeenAtGetsUsedIfAlreadyPresent) {
-  OmahaResponse response;
   request_params_.set_wall_clock_based_wait_enabled(true);
   request_params_.set_waiting_period(TimeDelta().FromDays(1));
   request_params_.set_update_check_count_wait_enabled(false);
@@ -2461,16 +2043,10 @@
   ASSERT_TRUE(
       fake_prefs_.SetInt64(kPrefsUpdateFirstSeenAt, t1.ToInternalValue()));
   fake_system_state_.fake_clock()->SetWallclockTime(t2);
-  ASSERT_TRUE(TestUpdateCheck(fake_update_response_.GetUpdateResponse(),
-                              -1,
-                              false,  // ping_only
-                              ErrorCode::kSuccess,
-                              metrics::CheckResult::kUpdateAvailable,
-                              metrics::CheckReaction::kUpdating,
-                              metrics::DownloadErrorCode::kUnset,
-                              &response,
-                              nullptr));
 
+  tuc_params_.http_response = fake_update_response_.GetUpdateResponse();
+
+  ASSERT_TRUE(TestUpdateCheck());
   EXPECT_TRUE(response.update_exists);
 
   // Make sure the timestamp t1 is unchanged showing that it was reused.
@@ -2484,7 +2060,6 @@
   base::ScopedTempDir tempdir;
   ASSERT_TRUE(tempdir.CreateUniqueTempDir());
 
-  brillo::Blob post_data;
   request_params_.set_root(tempdir.GetPath().value());
   request_params_.set_app_id("{22222222-2222-2222-2222-222222222222}");
   request_params_.set_app_version("1.2.3.4");
@@ -2494,17 +2069,14 @@
       request_params_.SetTargetChannel("stable-channel", true, nullptr));
   request_params_.UpdateDownloadChannel();
   EXPECT_TRUE(request_params_.ShouldPowerwash());
-  ASSERT_FALSE(TestUpdateCheck("invalid xml>",
-                               -1,
-                               false,  // ping_only
-                               ErrorCode::kOmahaRequestXMLParseError,
-                               metrics::CheckResult::kParsingError,
-                               metrics::CheckReaction::kUnset,
-                               metrics::DownloadErrorCode::kUnset,
-                               nullptr,  // response
-                               &post_data));
-  // convert post_data to string
-  string post_str(post_data.begin(), post_data.end());
+
+  tuc_params_.http_response = "invalid xml>";
+  tuc_params_.expected_code = ErrorCode::kOmahaRequestXMLParseError;
+  tuc_params_.expected_check_result = metrics::CheckResult::kParsingError;
+  tuc_params_.expected_check_reaction = metrics::CheckReaction::kUnset;
+
+  ASSERT_FALSE(TestUpdateCheck());
+
   EXPECT_NE(
       string::npos,
       post_str.find("appid=\"{22222222-2222-2222-2222-222222222222}\" "
@@ -2518,7 +2090,6 @@
   base::ScopedTempDir tempdir;
   ASSERT_TRUE(tempdir.CreateUniqueTempDir());
 
-  brillo::Blob post_data;
   request_params_.set_root(tempdir.GetPath().value());
   request_params_.set_app_id("{11111111-1111-1111-1111-111111111111}");
   request_params_.set_app_version("5.6.7.8");
@@ -2528,17 +2099,14 @@
       request_params_.SetTargetChannel("canary-channel", false, nullptr));
   request_params_.UpdateDownloadChannel();
   EXPECT_FALSE(request_params_.ShouldPowerwash());
-  ASSERT_FALSE(TestUpdateCheck("invalid xml>",
-                               -1,
-                               false,  // ping_only
-                               ErrorCode::kOmahaRequestXMLParseError,
-                               metrics::CheckResult::kParsingError,
-                               metrics::CheckReaction::kUnset,
-                               metrics::DownloadErrorCode::kUnset,
-                               nullptr,  // response
-                               &post_data));
-  // Convert post_data to string.
-  string post_str(post_data.begin(), post_data.end());
+
+  tuc_params_.http_response = "invalid xml>";
+  tuc_params_.expected_code = ErrorCode::kOmahaRequestXMLParseError;
+  tuc_params_.expected_check_result = metrics::CheckResult::kParsingError;
+  tuc_params_.expected_check_reaction = metrics::CheckReaction::kUnset;
+
+  ASSERT_FALSE(TestUpdateCheck());
+
   EXPECT_NE(
       string::npos,
       post_str.find("appid=\"{11111111-1111-1111-1111-111111111111}\" "
@@ -2555,19 +2123,13 @@
 
   // Flag that the device was powerwashed in the past.
   fake_system_state_.fake_hardware()->SetPowerwashCount(1);
+  tuc_params_.http_response = fake_update_response_.GetNoUpdateResponse();
+  tuc_params_.expected_check_result = metrics::CheckResult::kNoUpdateAvailable;
+  tuc_params_.expected_check_reaction = metrics::CheckReaction::kUnset;
 
-  brillo::Blob post_data;
-  ASSERT_TRUE(TestUpdateCheck(fake_update_response_.GetNoUpdateResponse(),
-                              -1,
-                              false,  // ping_only
-                              ErrorCode::kSuccess,
-                              metrics::CheckResult::kNoUpdateAvailable,
-                              metrics::CheckReaction::kUnset,
-                              metrics::DownloadErrorCode::kUnset,
-                              nullptr,
-                              &post_data));
+  ASSERT_TRUE(TestUpdateCheck());
+
   // We shouldn't send a ping in this case since powerwash > 0.
-  string post_str(post_data.begin(), post_data.end());
   EXPECT_EQ(string::npos, post_str.find("<ping"));
 }
 
@@ -2582,19 +2144,14 @@
   // Flag that the device has sent first active ping in the past.
   fake_system_state_.fake_hardware()->SetFirstActiveOmahaPingSent();
 
-  brillo::Blob post_data;
-  ASSERT_TRUE(TestUpdateCheck(fake_update_response_.GetNoUpdateResponse(),
-                              -1,
-                              false,  // ping_only
-                              ErrorCode::kSuccess,
-                              metrics::CheckResult::kNoUpdateAvailable,
-                              metrics::CheckReaction::kUnset,
-                              metrics::DownloadErrorCode::kUnset,
-                              nullptr,
-                              &post_data));
+  tuc_params_.http_response = fake_update_response_.GetNoUpdateResponse();
+  tuc_params_.expected_check_result = metrics::CheckResult::kNoUpdateAvailable;
+  tuc_params_.expected_check_reaction = metrics::CheckReaction::kUnset;
+
+  ASSERT_TRUE(TestUpdateCheck());
+
   // We shouldn't send a ping in this case since
   // first_active_omaha_ping_sent=true
-  string post_str(post_data.begin(), post_data.end());
   EXPECT_EQ(string::npos, post_str.find("<ping"));
 }
 
@@ -2603,17 +2160,11 @@
   // Flag that the device was updated in a previous boot.
   fake_prefs_.SetString(kPrefsPreviousVersion, "1.2.3.4");
 
-  brillo::Blob post_data;
-  ASSERT_TRUE(TestUpdateCheck(fake_update_response_.GetNoUpdateResponse(),
-                              -1,
-                              false,  // ping_only
-                              ErrorCode::kSuccess,
-                              metrics::CheckResult::kNoUpdateAvailable,
-                              metrics::CheckReaction::kUnset,
-                              metrics::DownloadErrorCode::kUnset,
-                              nullptr,
-                              &post_data));
-  string post_str(post_data.begin(), post_data.end());
+  tuc_params_.http_response = fake_update_response_.GetNoUpdateResponse();
+  tuc_params_.expected_check_result = metrics::CheckResult::kNoUpdateAvailable;
+  tuc_params_.expected_check_reaction = metrics::CheckReaction::kUnset;
+
+  ASSERT_TRUE(TestUpdateCheck());
 
   // An event 54 is included and has the right version.
   EXPECT_NE(
@@ -2640,7 +2191,6 @@
                                      bool expected_allow_p2p_for_downloading,
                                      bool expected_allow_p2p_for_sharing,
                                      const string& expected_p2p_url) {
-  OmahaResponse response;
   bool actual_allow_p2p_for_downloading = initial_allow_p2p_for_downloading;
   bool actual_allow_p2p_for_sharing = initial_allow_p2p_for_sharing;
   string actual_p2p_url;
@@ -2671,15 +2221,11 @@
   fake_update_response_.disable_p2p_for_downloading =
       omaha_disable_p2p_for_downloading;
   fake_update_response_.disable_p2p_for_sharing = omaha_disable_p2p_for_sharing;
-  ASSERT_TRUE(TestUpdateCheck(fake_update_response_.GetUpdateResponse(),
-                              -1,
-                              false,  // ping_only
-                              ErrorCode::kSuccess,
-                              metrics::CheckResult::kUpdateAvailable,
-                              metrics::CheckReaction::kUpdating,
-                              metrics::DownloadErrorCode::kUnset,
-                              &response,
-                              nullptr));
+
+  tuc_params_.http_response = fake_update_response_.GetUpdateResponse();
+  tuc_params_.expected_check_result = metrics::CheckResult::kUpdateAvailable;
+
+  ASSERT_TRUE(TestUpdateCheck());
   EXPECT_TRUE(response.update_exists);
 
   EXPECT_EQ(omaha_disable_p2p_for_downloading,
@@ -2773,20 +2319,12 @@
 bool OmahaRequestActionTest::InstallDateParseHelper(const string& elapsed_days,
                                                     OmahaResponse* response) {
   fake_update_response_.elapsed_days = elapsed_days;
-  return TestUpdateCheck(fake_update_response_.GetUpdateResponse(),
-                         -1,
-                         false,  // ping_only
-                         ErrorCode::kSuccess,
-                         metrics::CheckResult::kUpdateAvailable,
-                         metrics::CheckReaction::kUpdating,
-                         metrics::DownloadErrorCode::kUnset,
-                         response,
-                         nullptr);
+  tuc_params_.http_response = fake_update_response_.GetUpdateResponse();
+
+  return TestUpdateCheck();
 }
 
 TEST_F(OmahaRequestActionTest, ParseInstallDateFromResponse) {
-  OmahaResponse response;
-
   // Simulate a successful update check that happens during OOBE.  The
   // deadline in the response is needed to force the update attempt to
   // occur; responses without a deadline seen during OOBE will normally
@@ -2902,11 +2440,13 @@
       ReportKeyVersionMetrics(min_kernel_version, min_kernel_version, true))
       .Times(1);
 
-  OmahaResponse response;
-  TestRollbackCheck(false /* is_consumer_device */,
-                    3 /* rollback_allowed_milestones */,
-                    false /* is_policy_loaded */,
-                    &response);
+  fake_update_response_.deadline = "20101020";
+  tuc_params_.http_response = fake_update_response_.GetUpdateResponse();
+  tuc_params_.is_consumer_device = false;
+  tuc_params_.rollback_allowed_milestones = 3;
+
+  EXPECT_TRUE(TestUpdateCheck());
+  EXPECT_TRUE(response.update_exists);
 
   // Verify kernel_max_rollforward was set to the current minimum
   // kernel key version. This has the effect of freezing roll
@@ -2936,11 +2476,13 @@
       ReportKeyVersionMetrics(min_kernel_version, kRollforwardInfinity, true))
       .Times(1);
 
-  OmahaResponse response;
-  TestRollbackCheck(true /* is_consumer_device */,
-                    3 /* rollback_allowed_milestones */,
-                    false /* is_policy_loaded */,
-                    &response);
+  fake_update_response_.deadline = "20101020";
+  tuc_params_.http_response = fake_update_response_.GetUpdateResponse();
+  tuc_params_.is_consumer_device = true;
+  tuc_params_.rollback_allowed_milestones = 3;
+
+  EXPECT_TRUE(TestUpdateCheck());
+  EXPECT_TRUE(response.update_exists);
 
   // Verify that with rollback disabled that kernel_max_rollforward
   // was set to logical infinity. This is the expected behavior for
@@ -2969,11 +2511,14 @@
       ReportKeyVersionMetrics(min_kernel_version, min_kernel_version, true))
       .Times(1);
 
-  OmahaResponse response;
-  TestRollbackCheck(false /* is_consumer_device */,
-                    allowed_milestones,
-                    true /* is_policy_loaded */,
-                    &response);
+  fake_update_response_.deadline = "20101020";
+  tuc_params_.http_response = fake_update_response_.GetUpdateResponse();
+  tuc_params_.is_consumer_device = false;
+  tuc_params_.rollback_allowed_milestones = allowed_milestones;
+  tuc_params_.is_policy_loaded = true;
+
+  EXPECT_TRUE(TestUpdateCheck());
+  EXPECT_TRUE(response.update_exists);
 
   // Verify that with rollback enabled that kernel_max_rollforward
   // was set to the current minimum kernel key version. This has
@@ -3003,11 +2548,14 @@
       ReportKeyVersionMetrics(min_kernel_version, kRollforwardInfinity, true))
       .Times(1);
 
-  OmahaResponse response;
-  TestRollbackCheck(false /* is_consumer_device */,
-                    allowed_milestones,
-                    true /* is_policy_loaded */,
-                    &response);
+  fake_update_response_.deadline = "20101020";
+  tuc_params_.http_response = fake_update_response_.GetUpdateResponse();
+  tuc_params_.is_consumer_device = false;
+  tuc_params_.rollback_allowed_milestones = allowed_milestones;
+  tuc_params_.is_policy_loaded = true;
+
+  EXPECT_TRUE(TestUpdateCheck());
+  EXPECT_TRUE(response.update_exists);
 
   // Verify that with rollback disabled that kernel_max_rollforward
   // was set to logical infinity.
@@ -3016,24 +2564,30 @@
 }
 
 TEST_F(OmahaRequestActionTest, RollbackResponseParsedNoEntries) {
-  OmahaResponse response;
   fake_update_response_.rollback = true;
-  TestRollbackCheck(false /* is_consumer_device */,
-                    4 /* rollback_allowed_milestones */,
-                    true /* is_policy_loaded */,
-                    &response);
+  fake_update_response_.deadline = "20101020";
+  tuc_params_.http_response = fake_update_response_.GetUpdateResponse();
+  tuc_params_.is_consumer_device = false;
+  tuc_params_.rollback_allowed_milestones = 4;
+  tuc_params_.is_policy_loaded = true;
+
+  EXPECT_TRUE(TestUpdateCheck());
+  EXPECT_TRUE(response.update_exists);
   EXPECT_TRUE(response.is_rollback);
 }
 
 TEST_F(OmahaRequestActionTest, RollbackResponseValidVersionsParsed) {
-  OmahaResponse response;
   fake_update_response_.rollback_firmware_version = "1.2";
   fake_update_response_.rollback_kernel_version = "3.4";
   fake_update_response_.rollback = true;
-  TestRollbackCheck(false /* is_consumer_device */,
-                    4 /* rollback_allowed_milestones */,
-                    true /* is_policy_loaded */,
-                    &response);
+  fake_update_response_.deadline = "20101020";
+  tuc_params_.http_response = fake_update_response_.GetUpdateResponse();
+  tuc_params_.is_consumer_device = false;
+  tuc_params_.rollback_allowed_milestones = 4;
+  tuc_params_.is_policy_loaded = true;
+
+  EXPECT_TRUE(TestUpdateCheck());
+  EXPECT_TRUE(response.update_exists);
   EXPECT_TRUE(response.is_rollback);
   EXPECT_EQ(1, response.rollback_key_version.firmware_key);
   EXPECT_EQ(2, response.rollback_key_version.firmware);
@@ -3047,17 +2601,10 @@
   Time now = Time::Now();
   fake_clock.SetWallclockTime(now);
   fake_system_state_.set_clock(&fake_clock);
+  tuc_params_.http_response = fake_update_response_.GetUpdateResponse();
 
-  OmahaResponse response;
-  ASSERT_TRUE(TestUpdateCheck(fake_update_response_.GetUpdateResponse(),
-                              -1,
-                              false,  // ping_only
-                              ErrorCode::kSuccess,
-                              metrics::CheckResult::kUpdateAvailable,
-                              metrics::CheckReaction::kUpdating,
-                              metrics::DownloadErrorCode::kUnset,
-                              &response,
-                              nullptr));
+  ASSERT_TRUE(TestUpdateCheck());
+
   EXPECT_TRUE(response.update_exists);
   EXPECT_TRUE(fake_prefs_.Exists(kPrefsUpdateFirstSeenAt));
 
@@ -3074,39 +2621,23 @@
   fake_clock.SetWallclockTime(now);
   fake_system_state_.set_clock(&fake_clock);
 
-  OmahaResponse response;
-  ASSERT_TRUE(TestUpdateCheck(fake_update_response_.GetNoUpdateResponse(),
-                              -1,
-                              false,  // ping_only
-                              ErrorCode::kSuccess,
-                              metrics::CheckResult::kNoUpdateAvailable,
-                              metrics::CheckReaction::kUnset,
-                              metrics::DownloadErrorCode::kUnset,
-                              &response,
-                              nullptr));
+  tuc_params_.http_response = fake_update_response_.GetNoUpdateResponse();
+  tuc_params_.expected_check_result = metrics::CheckResult::kNoUpdateAvailable;
+  tuc_params_.expected_check_reaction = metrics::CheckReaction::kUnset;
+
+  ASSERT_TRUE(TestUpdateCheck());
+
   EXPECT_FALSE(response.update_exists);
   EXPECT_FALSE(fake_prefs_.Exists(kPrefsUpdateFirstSeenAt));
 }
 
 TEST_F(OmahaRequestActionTest, InstallTest) {
-  OmahaResponse response;
   request_params_.set_is_install(true);
   request_params_.set_dlc_module_ids({"dlc_no_0", "dlc_no_1"});
-  brillo::Blob post_data;
-  ASSERT_TRUE(TestUpdateCheck(fake_update_response_.GetUpdateResponse(),
-                              -1,
-                              false,  // ping_only
-                              true,   // is_consumer_device
-                              0,      // rollback_allowed_milestones
-                              false,  // is_policy_loaded
-                              ErrorCode::kSuccess,
-                              metrics::CheckResult::kUpdateAvailable,
-                              metrics::CheckReaction::kUpdating,
-                              metrics::DownloadErrorCode::kUnset,
-                              &response,
-                              &post_data));
-  // Convert post_data to string.
-  string post_str(post_data.begin(), post_data.end());
+  tuc_params_.http_response = fake_update_response_.GetUpdateResponse();
+
+  ASSERT_TRUE(TestUpdateCheck());
+
   for (const auto& dlc_module_id : request_params_.dlc_module_ids()) {
     EXPECT_NE(string::npos,
               post_str.find("appid=\"" + fake_update_response_.app_id + "_" +
@@ -3131,29 +2662,26 @@
   request_params_.set_is_install(true);
   request_params_.set_dlc_module_ids({"dlc_no_0", "dlc_no_1"});
   request_params_.set_app_id(fake_update_response_.app_id_skip_updatecheck);
-  OmahaResponse response;
-  ASSERT_TRUE(TestUpdateCheck(fake_update_response_.GetUpdateResponse(),
-                              -1,
-                              false,  // ping_only
-                              ErrorCode::kSuccess,
-                              metrics::CheckResult::kUpdateAvailable,
-                              metrics::CheckReaction::kUpdating,
-                              metrics::DownloadErrorCode::kUnset,
-                              &response,
-                              nullptr));
+  tuc_params_.http_response = fake_update_response_.GetUpdateResponse();
+
+  ASSERT_TRUE(TestUpdateCheck());
+
   EXPECT_TRUE(response.update_exists);
   EXPECT_EQ(fake_update_response_.current_version, response.version);
 }
 
 TEST_F(OmahaRequestActionTest, PastRollbackVersionsNoEntries) {
-  OmahaResponse response;
   fake_update_response_.rollback = true;
   fake_update_response_.rollback_allowed_milestones = 4;
   request_params_.set_rollback_allowed_milestones(4);
-  TestRollbackCheck(false /* is_consumer_device */,
-                    4 /* rollback_allowed_milestones */,
-                    true /* is_policy_loaded */,
-                    &response);
+  fake_update_response_.deadline = "20101020";
+  tuc_params_.http_response = fake_update_response_.GetUpdateResponse();
+  tuc_params_.is_consumer_device = false;
+  tuc_params_.rollback_allowed_milestones = 4;
+  tuc_params_.is_policy_loaded = true;
+
+  EXPECT_TRUE(TestUpdateCheck());
+  EXPECT_TRUE(response.update_exists);
   EXPECT_TRUE(response.is_rollback);
   EXPECT_EQ(std::numeric_limits<uint16_t>::max(),
             response.past_rollback_key_version.firmware_key);
@@ -3166,7 +2694,6 @@
 }
 
 TEST_F(OmahaRequestActionTest, PastRollbackVersionsValidEntries) {
-  OmahaResponse response;
   request_params_.set_rollback_allowed_milestones(4);
   fake_update_response_.rollback = true;
   fake_update_response_.rollback_allowed_milestones = 4;
@@ -3174,10 +2701,14 @@
   fake_update_response_.rollback_kernel_version = "2.1";
   fake_update_response_.past_rollback_key_version =
       std::make_pair("16.15", "14.13");
-  TestRollbackCheck(false /* is_consumer_device */,
-                    4 /* rollback_allowed_milestones */,
-                    true /* is_policy_loaded */,
-                    &response);
+  fake_update_response_.deadline = "20101020";
+  tuc_params_.http_response = fake_update_response_.GetUpdateResponse();
+  tuc_params_.is_consumer_device = false;
+  tuc_params_.rollback_allowed_milestones = 4;
+  tuc_params_.is_policy_loaded = true;
+
+  EXPECT_TRUE(TestUpdateCheck());
+  EXPECT_TRUE(response.update_exists);
   EXPECT_TRUE(response.is_rollback);
   EXPECT_EQ(16, response.past_rollback_key_version.firmware_key);
   EXPECT_EQ(15, response.past_rollback_key_version.firmware);
@@ -3186,20 +2717,22 @@
 }
 
 TEST_F(OmahaRequestActionTest, MismatchNumberOfVersions) {
-  OmahaResponse response;
   fake_update_response_.rollback = true;
   fake_update_response_.rollback_allowed_milestones = 2;
+  fake_update_response_.deadline = "20101020";
   request_params_.set_rollback_allowed_milestones(4);
 
   // Since |request_params_.rollback_allowed_milestones| is 4 but the response
   // is constructed with |fake_update_response_.rollback_allowed_milestones| set
   // to 2, OmahaRequestAction will look for the key values of N-4 version but
   // only the N-2 version will exist.
+  tuc_params_.http_response = fake_update_response_.GetUpdateResponse();
+  tuc_params_.is_consumer_device = false;
+  tuc_params_.rollback_allowed_milestones = 2;
+  tuc_params_.is_policy_loaded = true;
 
-  TestRollbackCheck(false /* is_consumer_device */,
-                    2 /* rollback_allowed_milestones */,
-                    true /* is_policy_loaded */,
-                    &response);
+  EXPECT_TRUE(TestUpdateCheck());
+  EXPECT_TRUE(response.update_exists);
   EXPECT_TRUE(response.is_rollback);
   EXPECT_EQ(std::numeric_limits<uint16_t>::max(),
             response.past_rollback_key_version.firmware_key);