summaryrefslogtreecommitdiff
path: root/update_attempter_unittest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'update_attempter_unittest.cc')
-rw-r--r--update_attempter_unittest.cc24
1 files changed, 24 insertions, 0 deletions
diff --git a/update_attempter_unittest.cc b/update_attempter_unittest.cc
index 5a6a23e9..3a1646fd 100644
--- a/update_attempter_unittest.cc
+++ b/update_attempter_unittest.cc
@@ -2317,6 +2317,30 @@ TEST_F(UpdateAttempterTest, IsEnterpriseRollbackInGetStatusTrue) {
EXPECT_TRUE(status.is_enterprise_rollback);
}
+TEST_F(UpdateAttempterTest, PowerwashInGetStatusDefault) {
+ UpdateEngineStatus status;
+ attempter_.GetStatus(&status);
+ EXPECT_FALSE(status.will_powerwash_after_reboot);
+}
+
+TEST_F(UpdateAttempterTest, PowerwashInGetStatusTrueBecausePowerwashRequired) {
+ attempter_.install_plan_.reset(new InstallPlan);
+ attempter_.install_plan_->powerwash_required = true;
+
+ UpdateEngineStatus status;
+ attempter_.GetStatus(&status);
+ EXPECT_TRUE(status.will_powerwash_after_reboot);
+}
+
+TEST_F(UpdateAttempterTest, PowerwashInGetStatusTrueBecauseRollback) {
+ attempter_.install_plan_.reset(new InstallPlan);
+ attempter_.install_plan_->is_rollback = true;
+
+ UpdateEngineStatus status;
+ attempter_.GetStatus(&status);
+ EXPECT_TRUE(status.will_powerwash_after_reboot);
+}
+
TEST_F(UpdateAttempterTest, FutureEolTest) {
EolDate eol_date = std::numeric_limits<int64_t>::max();
EXPECT_CALL(*prefs_, GetString(kPrefsOmahaEolDate, _))