Merge remote-tracking branch 'cros/upstream' into cros/master
BUG=chromium:815356
TEST=unittest
TEST=precq
TEST=cros flash
Change-Id: I8d9c37411708d0cae61613b285123a090ce6deb1
diff --git a/omaha_request_action_unittest.cc b/omaha_request_action_unittest.cc
index f2a83f7..7c9fe41 100644
--- a/omaha_request_action_unittest.cc
+++ b/omaha_request_action_unittest.cc
@@ -153,6 +153,7 @@
(disable_p2p_for_downloading ? "DisableP2PForDownloading=\"true\" "
: "") +
(disable_p2p_for_sharing ? "DisableP2PForSharing=\"true\" " : "") +
+ (powerwash ? "Powerwash=\"true\" " : "") +
"/></actions></manifest></updatecheck></app>" +
(multi_app
? "<app appid=\"" + app_id2 + "\"" +
@@ -200,6 +201,8 @@
bool disable_p2p_for_downloading = false;
bool disable_p2p_for_sharing = false;
+ bool powerwash = false;
+
// Omaha cohorts settings.
bool include_cohorts = false;
string cohort = "";
@@ -640,6 +643,7 @@
EXPECT_EQ(true, response.packages[0].is_delta);
EXPECT_EQ(fake_update_response_.prompt == "true", response.prompt);
EXPECT_EQ(fake_update_response_.deadline, response.deadline);
+ EXPECT_FALSE(response.powerwash_required);
// Omaha cohort attributes are not set in the response, so they should not be
// persisted.
EXPECT_FALSE(fake_prefs_.Exists(kPrefsOmahaCohort));
@@ -803,6 +807,22 @@
EXPECT_EQ(false, response.packages[2].is_delta);
}
+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));
+ EXPECT_TRUE(response.update_exists);
+ EXPECT_TRUE(response.powerwash_required);
+}
+
TEST_F(OmahaRequestActionTest, ExtraHeadersSentTest) {
const string http_response = "<?xml invalid response";
request_params_.set_interactive(true);