• Home
  • Raw
  • Download

Lines Matching refs:attempter_

133     fake_system_state_.set_update_attempter(&attempter_);  in UpdateAttempterTest()
139 attempter_.set_forced_update_pending_callback( in UpdateAttempterTest()
142 attempter_.Init(); in UpdateAttempterTest()
146 EXPECT_NE(nullptr, attempter_.system_state_); in SetUp()
147 EXPECT_EQ(0, attempter_.http_response_code_); in SetUp()
148 EXPECT_EQ(UpdateStatus::IDLE, attempter_.status_); in SetUp()
149 EXPECT_EQ(0.0, attempter_.download_progress_); in SetUp()
150 EXPECT_EQ(0, attempter_.last_checked_time_); in SetUp()
151 EXPECT_EQ("0.0.0.0", attempter_.new_version_); in SetUp()
152 EXPECT_EQ(0ULL, attempter_.new_payload_size_); in SetUp()
154 attempter_.processor_.reset(processor_); // Transfers ownership. in SetUp()
210 UpdateAttempterUnderTest attempter_{&fake_system_state_}; member in chromeos_update_engine::UpdateAttempterTest
240 attempter_.ActionCompleted(nullptr, &action, ErrorCode::kSuccess); in TEST_F()
241 EXPECT_EQ(UpdateStatus::FINALIZING, attempter_.status()); in TEST_F()
242 EXPECT_EQ(0.0, attempter_.download_progress_); in TEST_F()
243 ASSERT_EQ(nullptr, attempter_.error_event_.get()); in TEST_F()
249 attempter_.status_ = UpdateStatus::DOWNLOADING; in TEST_F()
252 attempter_.ActionCompleted(nullptr, &action, ErrorCode::kError); in TEST_F()
253 ASSERT_NE(nullptr, attempter_.error_event_.get()); in TEST_F()
269 EXPECT_EQ(0.0, attempter_.download_progress_); in TEST_F()
272 attempter_.new_payload_size_ = bytes_total; in TEST_F()
284 attempter_.AddObserver(&observer); in TEST_F()
285 attempter_.BytesReceived(bytes_progressed_1, bytes_received_1, bytes_total); in TEST_F()
286 EXPECT_EQ(progress_1, attempter_.download_progress_); in TEST_F()
290 attempter_.BytesReceived(bytes_progressed_2, bytes_received_2, bytes_total); in TEST_F()
291 EXPECT_EQ(progress_2, attempter_.download_progress_); in TEST_F()
300 attempter_.status_ = UpdateStatus::CHECKING_FOR_UPDATE; in TEST_F()
303 attempter_.new_payload_size_ = bytes_total; in TEST_F()
304 EXPECT_EQ(0.0, attempter_.download_progress_); in TEST_F()
310 attempter_.AddObserver(&observer); in TEST_F()
311 attempter_.BytesReceived(bytes_progressed, bytes_received, bytes_total); in TEST_F()
312 EXPECT_EQ(UpdateStatus::DOWNLOADING, attempter_.status_); in TEST_F()
322 attempter_.status_ = UpdateStatus::DOWNLOADING; in TEST_F()
323 attempter_.new_payload_size_ = bytes_total; in TEST_F()
324 EXPECT_EQ(0.0, attempter_.download_progress_); in TEST_F()
331 attempter_.AddObserver(&observer); in TEST_F()
332 attempter_.BytesReceived(bytes_progressed, bytes_received, bytes_total); in TEST_F()
333 EXPECT_EQ(1.0, attempter_.download_progress_); in TEST_F()
347 attempter_.ActionCompleted(nullptr, &action, ErrorCode::kSuccess); in TEST_F()
348 EXPECT_EQ(500, attempter_.http_response_code()); in TEST_F()
349 EXPECT_EQ(UpdateStatus::IDLE, attempter_.status()); in TEST_F()
350 EXPECT_EQ(234U, attempter_.server_dictated_poll_interval_); in TEST_F()
351 ASSERT_TRUE(attempter_.error_event_.get() == nullptr); in TEST_F()
360 attempter_.Init(); in TEST_F()
361 EXPECT_EQ(UpdateStatus::UPDATED_NEED_REBOOT, attempter_.status()); in TEST_F()
393 attempter_.omaha_request_params_->set_delta_okay(true); in TEST_F()
396 attempter_.DisableDeltaUpdateIfNeeded(); in TEST_F()
397 EXPECT_TRUE(attempter_.omaha_request_params_->delta_okay()); in TEST_F()
402 attempter_.DisableDeltaUpdateIfNeeded(); in TEST_F()
403 EXPECT_TRUE(attempter_.omaha_request_params_->delta_okay()); in TEST_F()
408 attempter_.DisableDeltaUpdateIfNeeded(); in TEST_F()
409 EXPECT_FALSE(attempter_.omaha_request_params_->delta_okay()); in TEST_F()
411 attempter_.DisableDeltaUpdateIfNeeded(); in TEST_F()
412 EXPECT_FALSE(attempter_.omaha_request_params_->delta_okay()); in TEST_F()
431 attempter_.MarkDeltaUpdateFailure(); in TEST_F()
445 attempter_.ScheduleErrorEventAction(); in TEST_F()
456 attempter_.error_event_.reset(new OmahaEvent( in TEST_F()
458 attempter_.ScheduleErrorEventAction(); in TEST_F()
459 EXPECT_EQ(UpdateStatus::REPORTING_ERROR_EVENT, attempter_.status()); in TEST_F()
488 attempter_.set_http_response_code(200); in UpdateTestStart()
496 attempter_.policy_provider_.reset( in UpdateTestStart()
509 attempter_.Update("", "", "", "", false, false, false); in UpdateTestStart()
516 EXPECT_EQ(0, attempter_.http_response_code()); in UpdateTestVerify()
517 EXPECT_EQ(&attempter_, processor_->delegate()); in UpdateTestVerify()
518 EXPECT_EQ(UpdateStatus::CHECKING_FOR_UPDATE, attempter_.status()); in UpdateTestVerify()
539 attempter_.policy_provider_.reset( in RollbackTestStart()
567 EXPECT_TRUE(attempter_.Rollback(true)); in RollbackTestStart()
572 EXPECT_FALSE(attempter_.Rollback(true)); in RollbackTestStart()
579 EXPECT_EQ(&attempter_, processor_->delegate()); in RollbackTestVerify()
580 EXPECT_EQ(UpdateStatus::ATTEMPTING_ROLLBACK, attempter_.status()); in RollbackTestVerify()
581 EXPECT_EQ(0U, attempter_.install_plan_->partitions.size()); in RollbackTestVerify()
582 EXPECT_EQ(attempter_.install_plan_->powerwash_required, true); in RollbackTestVerify()
623 attempter_.PingOmaha(); in PingOmahaTestStart()
628 EXPECT_FALSE(attempter_.waiting_for_scheduled_check_); in TEST_F()
629 EXPECT_FALSE(attempter_.schedule_updates_called()); in TEST_F()
632 attempter_.DisableScheduleUpdates(); in TEST_F()
637 EXPECT_EQ(UpdateStatus::UPDATED_NEED_REBOOT, attempter_.status()); in TEST_F()
638 EXPECT_TRUE(attempter_.schedule_updates_called()); in TEST_F()
644 attempter_.CreatePendingErrorEvent(&action, kCode); in TEST_F()
645 ASSERT_NE(nullptr, attempter_.error_event_.get()); in TEST_F()
646 EXPECT_EQ(OmahaEvent::kTypeUpdateComplete, attempter_.error_event_->type); in TEST_F()
647 EXPECT_EQ(OmahaEvent::kResultError, attempter_.error_event_->result); in TEST_F()
651 attempter_.error_event_->error_code); in TEST_F()
655 attempter_.install_plan_.reset(new InstallPlan); in TEST_F()
656 attempter_.install_plan_->is_resume = true; in TEST_F()
659 attempter_.CreatePendingErrorEvent(&action, kCode); in TEST_F()
660 ASSERT_NE(nullptr, attempter_.error_event_.get()); in TEST_F()
661 EXPECT_EQ(OmahaEvent::kTypeUpdateComplete, attempter_.error_event_->type); in TEST_F()
662 EXPECT_EQ(OmahaEvent::kResultError, attempter_.error_event_->result); in TEST_F()
667 attempter_.error_event_->error_code); in TEST_F()
675 attempter_.UpdateEngineStarted(); in TEST_F()
683 attempter_.UpdateEngineStarted(); in TEST_F()
692 attempter_.UpdateEngineStarted(); in TEST_F()
709 attempter_.Update("", "", "", "", false, false, false); in P2PNotEnabledStart()
731 attempter_.Update("", "", "", "", false, false, false); in P2PEnabledStartingFailsStart()
754 attempter_.Update("", "", "", "", false, false, false); in P2PEnabledHousekeepingFailsStart()
776 attempter_.Update("", "", "", "", false, false, false); in P2PEnabledStart()
799 attempter_.Update("", in P2PEnabledInteractiveStart()
832 attempter_.policy_provider_.reset( in ReadScatterFactorFromPolicyTestStart()
835 attempter_.Update("", "", "", "", false, false, false); in ReadScatterFactorFromPolicyTestStart()
836 EXPECT_EQ(scatter_factor_in_seconds, attempter_.scatter_factor_.InSeconds()); in ReadScatterFactorFromPolicyTestStart()
854 attempter_.prefs_ = &fake_prefs; in DecrementUpdateCheckCountTestStart()
870 attempter_.policy_provider_.reset( in DecrementUpdateCheckCountTestStart()
873 attempter_.Update("", "", "", "", false, false, false); in DecrementUpdateCheckCountTestStart()
874 EXPECT_EQ(scatter_factor_in_seconds, attempter_.scatter_factor_.InSeconds()); in DecrementUpdateCheckCountTestStart()
884 attempter_.omaha_request_params_->update_check_count_wait_enabled()); in DecrementUpdateCheckCountTestStart()
889 attempter_.Update("", "", "", "", false, false, false); in DecrementUpdateCheckCountTestStart()
911 attempter_.prefs_ = &fake_prefs; in NoScatteringDoneDuringManualUpdateTestStart()
932 attempter_.policy_provider_.reset( in NoScatteringDoneDuringManualUpdateTestStart()
936 attempter_.Update("", in NoScatteringDoneDuringManualUpdateTestStart()
943 EXPECT_EQ(scatter_factor_in_seconds, attempter_.scatter_factor_.InSeconds()); in NoScatteringDoneDuringManualUpdateTestStart()
948 attempter_.omaha_request_params_->wall_clock_based_wait_enabled()); in NoScatteringDoneDuringManualUpdateTestStart()
950 EXPECT_EQ(0, attempter_.omaha_request_params_->waiting_period().InSeconds()); in NoScatteringDoneDuringManualUpdateTestStart()
952 attempter_.omaha_request_params_->update_check_count_wait_enabled()); in NoScatteringDoneDuringManualUpdateTestStart()
960 attempter_.prefs_ = prefs; in SetUpStagingTest()
967 attempter_.scatter_factor_ = TimeDelta::FromSeconds(20); in SetUpStagingTest()
975 attempter_.policy_provider_.reset( in SetUpStagingTest()
994 attempter_.Update("", "", "", "", false, false, false); in StagingSetsPrefsAndTurnsOffScatteringStart()
1006 attempter_.omaha_request_params_->update_check_count_wait_enabled()); in StagingSetsPrefsAndTurnsOffScatteringStart()
1008 attempter_.omaha_request_params_->wall_clock_based_wait_enabled()); in StagingSetsPrefsAndTurnsOffScatteringStart()
1010 attempter_.omaha_request_params_->waiting_period().InDays()); in StagingSetsPrefsAndTurnsOffScatteringStart()
1012 EXPECT_EQ(waiting_time_days, attempter_.staging_wait_time_.InDays()); in StagingSetsPrefsAndTurnsOffScatteringStart()
1013 EXPECT_EQ(kValidStagingSchedule, attempter_.staging_schedule_); in StagingSetsPrefsAndTurnsOffScatteringStart()
1015 EXPECT_EQ(0, attempter_.scatter_factor_.InSeconds()); in StagingSetsPrefsAndTurnsOffScatteringStart()
1023 EXPECT_FALSE(attempter_.prefs_->Exists(kPrefsUpdateCheckCount)); in CheckStagingOff()
1024 EXPECT_FALSE(attempter_.prefs_->Exists(kPrefsWallClockScatteringWaitPeriod)); in CheckStagingOff()
1025 EXPECT_FALSE(attempter_.prefs_->Exists(kPrefsWallClockStagingWaitPeriod)); in CheckStagingOff()
1027 EXPECT_EQ(0, attempter_.omaha_request_params_->waiting_period().InDays()); in CheckStagingOff()
1028 EXPECT_EQ(attempter_.omaha_request_params_->waiting_period(), in CheckStagingOff()
1029 attempter_.staging_wait_time_); in CheckStagingOff()
1031 attempter_.omaha_request_params_->update_check_count_wait_enabled()); in CheckStagingOff()
1033 attempter_.omaha_request_params_->wall_clock_based_wait_enabled()); in CheckStagingOff()
1035 EXPECT_EQ(0, attempter_.scatter_factor_.InSeconds()); in CheckStagingOff()
1051 attempter_.Update("", "", "", "", false, false, /* interactive = */ true); in StagingOffIfInteractiveStart()
1071 attempter_.Update("", "", "", "", false, false, /* interactive = */ true); in StagingOffIfOobeStart()
1090 EXPECT_TRUE(attempter_.CheckAndReportDailyMetrics()); in TEST_F()
1092 EXPECT_FALSE(attempter_.CheckAndReportDailyMetrics()); in TEST_F()
1096 EXPECT_FALSE(attempter_.CheckAndReportDailyMetrics()); in TEST_F()
1101 EXPECT_FALSE(attempter_.CheckAndReportDailyMetrics()); in TEST_F()
1105 EXPECT_TRUE(attempter_.CheckAndReportDailyMetrics()); in TEST_F()
1108 EXPECT_FALSE(attempter_.CheckAndReportDailyMetrics()); in TEST_F()
1112 EXPECT_FALSE(attempter_.CheckAndReportDailyMetrics()); in TEST_F()
1114 EXPECT_TRUE(attempter_.CheckAndReportDailyMetrics()); in TEST_F()
1115 EXPECT_FALSE(attempter_.CheckAndReportDailyMetrics()); in TEST_F()
1119 EXPECT_FALSE(attempter_.CheckAndReportDailyMetrics()); in TEST_F()
1121 EXPECT_TRUE(attempter_.CheckAndReportDailyMetrics()); in TEST_F()
1122 EXPECT_FALSE(attempter_.CheckAndReportDailyMetrics()); in TEST_F()
1129 EXPECT_TRUE(attempter_.CheckAndReportDailyMetrics()); in TEST_F()
1130 EXPECT_FALSE(attempter_.CheckAndReportDailyMetrics()); in TEST_F()
1135 EXPECT_FALSE(attempter_.CheckAndReportDailyMetrics()); in TEST_F()
1137 EXPECT_TRUE(attempter_.CheckAndReportDailyMetrics()); in TEST_F()
1138 EXPECT_FALSE(attempter_.CheckAndReportDailyMetrics()); in TEST_F()
1147 attempter_.Init(); in TEST_F()
1150 EXPECT_FALSE(attempter_.GetBootTimeAtUpdate(&boot_time)); in TEST_F()
1152 attempter_.WriteUpdateCompletedMarker(); in TEST_F()
1154 EXPECT_TRUE(attempter_.GetBootTimeAtUpdate(&boot_time)); in TEST_F()
1160 EXPECT_TRUE(attempter_.IsAnyUpdateSourceAllowed()); in TEST_F()
1166 EXPECT_TRUE(attempter_.IsAnyUpdateSourceAllowed()); in TEST_F()
1172 EXPECT_FALSE(attempter_.IsAnyUpdateSourceAllowed()); in TEST_F()
1185 attempter_.CheckForUpdate("", "autest", UpdateAttemptFlags::kNone); in TEST_F()
1186 EXPECT_EQ(attempter_.dlc_module_ids_.size(), 1); in TEST_F()
1187 EXPECT_EQ(attempter_.dlc_module_ids_[0], dlc_module_id); in TEST_F()
1193 attempter_.CheckForUpdate("", "autest", UpdateAttemptFlags::kNone); in TEST_F()
1194 EXPECT_EQ(constants::kOmahaDefaultAUTestURL, attempter_.forced_omaha_url()); in TEST_F()
1200 attempter_.CheckForUpdate("", "autest-scheduled", UpdateAttemptFlags::kNone); in TEST_F()
1201 EXPECT_EQ(constants::kOmahaDefaultAUTestURL, attempter_.forced_omaha_url()); in TEST_F()
1207 attempter_.CheckForInstall({}, "autest"); in TEST_F()
1208 EXPECT_EQ(constants::kOmahaDefaultAUTestURL, attempter_.forced_omaha_url()); in TEST_F()
1210 attempter_.CheckForInstall({}, "autest-scheduled"); in TEST_F()
1211 EXPECT_EQ(constants::kOmahaDefaultAUTestURL, attempter_.forced_omaha_url()); in TEST_F()
1213 attempter_.CheckForInstall({}, "http://omaha.phishing"); in TEST_F()
1214 EXPECT_EQ("", attempter_.forced_omaha_url()); in TEST_F()
1218 attempter_.CheckForInstall({}, "http://foo.bar"); in TEST_F()
1219 attempter_.status_ = UpdateStatus::DOWNLOADING; in TEST_F()
1220 EXPECT_TRUE(attempter_.is_install_); in TEST_F()
1221 attempter_.ProcessingDone(nullptr, ErrorCode::kSuccess); in TEST_F()
1223 attempter_.GetStatus(&status); in TEST_F()
1229 attempter_.is_install_ = true; in TEST_F()
1230 attempter_.Rollback(false); in TEST_F()
1231 EXPECT_FALSE(attempter_.is_install_); in TEST_F()
1235 attempter_.is_install_ = true; in TEST_F()
1236 attempter_.CheckForUpdate("", "", UpdateAttemptFlags::kNone); in TEST_F()
1237 EXPECT_FALSE(attempter_.is_install_); in TEST_F()
1241 attempter_.CalculateUpdateParams("", "", "", "1234", false, false, false); in TEST_F()
1245 attempter_.CalculateUpdateParams("", "", "", "", false, false, false); in TEST_F()
1251 attempter_.CalculateUpdateParams("", in TEST_F()
1260 attempter_.CalculateUpdateParams("", in TEST_F()
1280 attempter_.ActionCompleted( in TEST_F()
1284 attempter_.GetStatus(&status); in TEST_F()
1286 EXPECT_TRUE(attempter_.install_plan_); in TEST_F()
1287 EXPECT_EQ(attempter_.install_plan_->version, status.new_version); in TEST_F()
1288 EXPECT_EQ(attempter_.install_plan_->system_version, in TEST_F()
1290 EXPECT_EQ(attempter_.install_plan_->payloads[0].size, in TEST_F()
1295 EXPECT_TRUE(nullptr != attempter_.error_event_); in TEST_F()
1296 EXPECT_EQ(OmahaEvent::kTypeUpdateComplete, attempter_.error_event_->type); in TEST_F()
1297 EXPECT_EQ(OmahaEvent::kResultUpdateDeferred, attempter_.error_event_->result); in TEST_F()
1301 EXPECT_EQ(expected_code, attempter_.error_event_->error_code); in TEST_F()
1303 attempter_.ProcessingDone(nullptr, ErrorCode::kOmahaUpdateDeferredPerPolicy); in TEST_F()
1307 attempter_.GetStatus(&status); in TEST_F()
1318 EXPECT_FALSE(attempter_.IsUpdateRunningOrScheduled()); in TEST_F()
1320 attempter_.status_ = UpdateStatus::UPDATE_AVAILABLE; in TEST_F()
1321 EXPECT_TRUE(attempter_.IsUpdateRunningOrScheduled()); in TEST_F()
1325 attempter_.SetUpdateAttemptFlags(UpdateAttemptFlags::kFlagRestrictDownload); in TEST_F()
1328 attempter_.OnUpdateScheduled(EvalStatus::kSucceeded, params); in TEST_F()
1331 attempter_.GetCurrentUpdateAttemptFlags()); in TEST_F()
1337 attempter_.OnUpdateScheduled(EvalStatus::kSucceeded, params); in TEST_F()
1344 attempter_.OnUpdateScheduled(EvalStatus::kSucceeded, params); in TEST_F()
1349 attempter_.SetUpdateAttemptFlags(UpdateAttemptFlags::kFlagRestrictDownload); in TEST_F()
1351 attempter_.CheckForUpdate("", "", UpdateAttemptFlags::kNone); in TEST_F()
1353 attempter_.GetCurrentUpdateAttemptFlags()); in TEST_F()
1357 attempter_.SetUpdateAttemptFlags(UpdateAttemptFlags::kNone); in TEST_F()
1361 attempter_.CheckForUpdate("", in TEST_F()
1366 attempter_.GetCurrentUpdateAttemptFlags()); in TEST_F()
1386 attempter_.policy_provider_ = std::move(mock_policy_provider); in ResetRollbackHappenedStart()
1387 attempter_.Update("", "", "", "", false, false, false); in ResetRollbackHappenedStart()
1422 attempter_.install_plan_.reset(new InstallPlan); in TEST_F()
1423 attempter_.install_plan_->is_rollback = true; in TEST_F()
1428 attempter_.ProcessingDone(nullptr, ErrorCode::kSuccess); in TEST_F()
1432 attempter_.install_plan_.reset(new InstallPlan); in TEST_F()
1433 attempter_.install_plan_->is_rollback = false; in TEST_F()
1438 attempter_.ProcessingDone(nullptr, ErrorCode::kSuccess); in TEST_F()
1442 attempter_.install_plan_.reset(new InstallPlan); in TEST_F()
1443 attempter_.install_plan_->is_rollback = true; in TEST_F()
1444 attempter_.install_plan_->version = kRollbackVersion; in TEST_F()
1449 attempter_.ProcessingDone(nullptr, ErrorCode::kSuccess); in TEST_F()
1453 attempter_.install_plan_.reset(new InstallPlan); in TEST_F()
1454 attempter_.install_plan_->is_rollback = false; in TEST_F()
1455 attempter_.install_plan_->version = kRollbackVersion; in TEST_F()
1460 attempter_.ProcessingDone(nullptr, ErrorCode::kSuccess); in TEST_F()
1464 attempter_.install_plan_.reset(new InstallPlan); in TEST_F()
1465 attempter_.install_plan_->is_rollback = true; in TEST_F()
1466 attempter_.install_plan_->version = kRollbackVersion; in TEST_F()
1472 attempter_.CreatePendingErrorEvent(&action, ErrorCode::kRollbackNotPossible); in TEST_F()
1473 attempter_.ProcessingDone(nullptr, ErrorCode::kRollbackNotPossible); in TEST_F()
1477 attempter_.install_plan_.reset(new InstallPlan); in TEST_F()
1478 attempter_.install_plan_->is_rollback = false; in TEST_F()
1479 attempter_.install_plan_->version = kRollbackVersion; in TEST_F()
1485 attempter_.CreatePendingErrorEvent(&action, ErrorCode::kRollbackNotPossible); in TEST_F()
1486 attempter_.ProcessingDone(nullptr, ErrorCode::kRollbackNotPossible); in TEST_F()
1493 attempter_.ProcessingDone(nullptr, ErrorCode::kOmahaUpdateDeferredPerPolicy); in TEST_F()
1506 attempter_.ProcessingDone(nullptr, ErrorCode::kSuccess); in TEST_F()
1536 attempter_.ProcessingDone(nullptr, ErrorCode::kSuccess); in TEST_F()
1566 attempter_.ProcessingDone(nullptr, ErrorCode::kSuccess); in TEST_F()