Lines Matching refs:attempter_

124     fake_system_state_.set_update_attempter(&attempter_);  in UpdateAttempterTest()
130 attempter_.Init(); in UpdateAttempterTest()
136 EXPECT_NE(nullptr, attempter_.system_state_); in SetUp()
137 EXPECT_EQ(0, attempter_.http_response_code_); in SetUp()
138 EXPECT_EQ(UpdateStatus::IDLE, attempter_.status_); in SetUp()
139 EXPECT_EQ(0.0, attempter_.download_progress_); in SetUp()
140 EXPECT_EQ(0, attempter_.last_checked_time_); in SetUp()
141 EXPECT_EQ("0.0.0.0", attempter_.new_version_); in SetUp()
142 EXPECT_EQ(0, attempter_.new_payload_size_); in SetUp()
144 attempter_.processor_.reset(processor_); // Transfers ownership. in SetUp()
204 UpdateAttempterUnderTest attempter_{&fake_system_state_, member in chromeos_update_engine::UpdateAttempterTest
227 attempter_.ActionCompleted(nullptr, &action, ErrorCode::kSuccess); in TEST_F()
228 EXPECT_EQ(503, attempter_.http_response_code()); in TEST_F()
229 EXPECT_EQ(UpdateStatus::FINALIZING, attempter_.status()); in TEST_F()
230 ASSERT_EQ(nullptr, attempter_.error_event_.get()); in TEST_F()
236 attempter_.status_ = UpdateStatus::DOWNLOADING; in TEST_F()
239 attempter_.ActionCompleted(nullptr, &action, ErrorCode::kError); in TEST_F()
240 ASSERT_NE(nullptr, attempter_.error_event_.get()); in TEST_F()
254 attempter_.ActionCompleted(nullptr, &action, ErrorCode::kSuccess); in TEST_F()
255 EXPECT_EQ(500, attempter_.http_response_code()); in TEST_F()
256 EXPECT_EQ(UpdateStatus::IDLE, attempter_.status()); in TEST_F()
257 EXPECT_EQ(234U, attempter_.server_dictated_poll_interval_); in TEST_F()
258 ASSERT_TRUE(attempter_.error_event_.get() == nullptr); in TEST_F()
305 attempter_.omaha_request_params_->set_delta_okay(true); in TEST_F()
308 attempter_.DisableDeltaUpdateIfNeeded(); in TEST_F()
309 EXPECT_TRUE(attempter_.omaha_request_params_->delta_okay()); in TEST_F()
314 attempter_.DisableDeltaUpdateIfNeeded(); in TEST_F()
315 EXPECT_TRUE(attempter_.omaha_request_params_->delta_okay()); in TEST_F()
320 attempter_.DisableDeltaUpdateIfNeeded(); in TEST_F()
321 EXPECT_FALSE(attempter_.omaha_request_params_->delta_okay()); in TEST_F()
323 attempter_.DisableDeltaUpdateIfNeeded(); in TEST_F()
324 EXPECT_FALSE(attempter_.omaha_request_params_->delta_okay()); in TEST_F()
342 attempter_.MarkDeltaUpdateFailure(); in TEST_F()
357 attempter_.ScheduleErrorEventAction(); in TEST_F()
368 attempter_.error_event_.reset(new OmahaEvent(OmahaEvent::kTypeUpdateComplete, in TEST_F()
371 attempter_.ScheduleErrorEventAction(); in TEST_F()
372 EXPECT_EQ(UpdateStatus::REPORTING_ERROR_EVENT, attempter_.status()); in TEST_F()
398 attempter_.set_http_response_code(200); in UpdateTestStart()
403 attempter_.policy_provider_.reset(new policy::PolicyProvider(device_policy)); in UpdateTestStart()
417 attempter_.Update("", "", "", "", false, false); in UpdateTestStart()
424 EXPECT_EQ(0, attempter_.http_response_code()); in UpdateTestVerify()
425 EXPECT_EQ(&attempter_, processor_->delegate()); in UpdateTestVerify()
426 EXPECT_EQ(arraysize(kUpdateActionTypes), attempter_.actions_.size()); in UpdateTestVerify()
428 EXPECT_EQ(kUpdateActionTypes[i], attempter_.actions_[i]->Type()); in UpdateTestVerify()
430 EXPECT_EQ(attempter_.response_handler_action_.get(), in UpdateTestVerify()
431 attempter_.actions_[1].get()); in UpdateTestVerify()
432 AbstractAction* action_4 = attempter_.actions_[4].get(); in UpdateTestVerify()
436 EXPECT_EQ(&attempter_, download_action->delegate()); in UpdateTestVerify()
437 EXPECT_EQ(UpdateStatus::CHECKING_FOR_UPDATE, attempter_.status()); in UpdateTestVerify()
445 attempter_.policy_provider_.reset(new policy::PolicyProvider(device_policy)); in RollbackTestStart()
487 EXPECT_TRUE(attempter_.Rollback(true)); in RollbackTestStart()
492 EXPECT_FALSE(attempter_.Rollback(true)); in RollbackTestStart()
499 EXPECT_EQ(&attempter_, processor_->delegate()); in RollbackTestVerify()
500 EXPECT_EQ(arraysize(kRollbackActionTypes), attempter_.actions_.size()); in RollbackTestVerify()
502 EXPECT_EQ(kRollbackActionTypes[i], attempter_.actions_[i]->Type()); in RollbackTestVerify()
504 EXPECT_EQ(UpdateStatus::ATTEMPTING_ROLLBACK, attempter_.status()); in RollbackTestVerify()
505 AbstractAction* action_0 = attempter_.actions_[0].get(); in RollbackTestVerify()
550 attempter_.PingOmaha(); in PingOmahaTestStart()
555 EXPECT_FALSE(attempter_.waiting_for_scheduled_check_); in TEST_F()
556 EXPECT_FALSE(attempter_.schedule_updates_called()); in TEST_F()
559 attempter_.DisableScheduleUpdates(); in TEST_F()
564 EXPECT_EQ(UpdateStatus::UPDATED_NEED_REBOOT, attempter_.status()); in TEST_F()
565 EXPECT_TRUE(attempter_.schedule_updates_called()); in TEST_F()
571 attempter_.CreatePendingErrorEvent(&action, kCode); in TEST_F()
572 ASSERT_NE(nullptr, attempter_.error_event_.get()); in TEST_F()
573 EXPECT_EQ(OmahaEvent::kTypeUpdateComplete, attempter_.error_event_->type); in TEST_F()
574 EXPECT_EQ(OmahaEvent::kResultError, attempter_.error_event_->result); in TEST_F()
578 attempter_.error_event_->error_code); in TEST_F()
585 attempter_.response_handler_action_.reset(response_action); in TEST_F()
588 attempter_.CreatePendingErrorEvent(&action, kCode); in TEST_F()
589 ASSERT_NE(nullptr, attempter_.error_event_.get()); in TEST_F()
590 EXPECT_EQ(OmahaEvent::kTypeUpdateComplete, attempter_.error_event_->type); in TEST_F()
591 EXPECT_EQ(OmahaEvent::kResultError, attempter_.error_event_->result); in TEST_F()
597 attempter_.error_event_->error_code); in TEST_F()
605 attempter_.UpdateEngineStarted(); in TEST_F()
613 attempter_.UpdateEngineStarted(); in TEST_F()
622 attempter_.UpdateEngineStarted(); in TEST_F()
639 attempter_.Update("", "", "", "", false, false); in P2PNotEnabledStart()
661 attempter_.Update("", "", "", "", false, false); in P2PEnabledStartingFailsStart()
684 attempter_.Update("", "", "", "", false, false); in P2PEnabledHousekeepingFailsStart()
706 attempter_.Update("", "", "", "", false, false); in P2PEnabledStart()
729 attempter_.Update("", "", "", "", false, true /* interactive */); in P2PEnabledInteractiveStart()
749 attempter_.policy_provider_.reset(new policy::PolicyProvider(device_policy)); in ReadScatterFactorFromPolicyTestStart()
759 attempter_.Update("", "", "", "", false, false); in ReadScatterFactorFromPolicyTestStart()
760 EXPECT_EQ(scatter_factor_in_seconds, attempter_.scatter_factor_.InSeconds()); in ReadScatterFactorFromPolicyTestStart()
778 attempter_.prefs_ = &fake_prefs; in DecrementUpdateCheckCountTestStart()
787 attempter_.policy_provider_.reset(new policy::PolicyProvider(device_policy)); in DecrementUpdateCheckCountTestStart()
797 attempter_.Update("", "", "", "", false, false); in DecrementUpdateCheckCountTestStart()
798 EXPECT_EQ(scatter_factor_in_seconds, attempter_.scatter_factor_.InSeconds()); in DecrementUpdateCheckCountTestStart()
808 attempter_.omaha_request_params_->update_check_count_wait_enabled()); in DecrementUpdateCheckCountTestStart()
813 attempter_.Update("", "", "", "", false, false); in DecrementUpdateCheckCountTestStart()
833 attempter_.prefs_ = &fake_prefs; in NoScatteringDoneDuringManualUpdateTestStart()
846 attempter_.policy_provider_.reset(new policy::PolicyProvider(device_policy)); in NoScatteringDoneDuringManualUpdateTestStart()
857 attempter_.Update("", "", "", "", false, true); in NoScatteringDoneDuringManualUpdateTestStart()
858 EXPECT_EQ(scatter_factor_in_seconds, attempter_.scatter_factor_.InSeconds()); in NoScatteringDoneDuringManualUpdateTestStart()
863 attempter_.omaha_request_params_->wall_clock_based_wait_enabled()); in NoScatteringDoneDuringManualUpdateTestStart()
865 EXPECT_EQ(0, attempter_.omaha_request_params_->waiting_period().InSeconds()); in NoScatteringDoneDuringManualUpdateTestStart()
867 attempter_.omaha_request_params_->update_check_count_wait_enabled()); in NoScatteringDoneDuringManualUpdateTestStart()
886 EXPECT_TRUE(attempter_.CheckAndReportDailyMetrics()); in TEST_F()
888 EXPECT_FALSE(attempter_.CheckAndReportDailyMetrics()); in TEST_F()
892 EXPECT_FALSE(attempter_.CheckAndReportDailyMetrics()); in TEST_F()
897 EXPECT_FALSE(attempter_.CheckAndReportDailyMetrics()); in TEST_F()
901 EXPECT_TRUE(attempter_.CheckAndReportDailyMetrics()); in TEST_F()
904 EXPECT_FALSE(attempter_.CheckAndReportDailyMetrics()); in TEST_F()
908 EXPECT_FALSE(attempter_.CheckAndReportDailyMetrics()); in TEST_F()
910 EXPECT_TRUE(attempter_.CheckAndReportDailyMetrics()); in TEST_F()
911 EXPECT_FALSE(attempter_.CheckAndReportDailyMetrics()); in TEST_F()
915 EXPECT_FALSE(attempter_.CheckAndReportDailyMetrics()); in TEST_F()
917 EXPECT_TRUE(attempter_.CheckAndReportDailyMetrics()); in TEST_F()
918 EXPECT_FALSE(attempter_.CheckAndReportDailyMetrics()); in TEST_F()
925 EXPECT_TRUE(attempter_.CheckAndReportDailyMetrics()); in TEST_F()
926 EXPECT_FALSE(attempter_.CheckAndReportDailyMetrics()); in TEST_F()
931 EXPECT_FALSE(attempter_.CheckAndReportDailyMetrics()); in TEST_F()
933 EXPECT_TRUE(attempter_.CheckAndReportDailyMetrics()); in TEST_F()
934 EXPECT_FALSE(attempter_.CheckAndReportDailyMetrics()); in TEST_F()
959 EXPECT_TRUE(attempter_.IsAnyUpdateSourceAllowed()); in TEST_F()
967 EXPECT_TRUE(attempter_.IsAnyUpdateSourceAllowed()); in TEST_F()
975 EXPECT_FALSE(attempter_.IsAnyUpdateSourceAllowed()); in TEST_F()
985 EXPECT_FALSE(attempter_.IsAnyUpdateSourceAllowed()); in TEST_F()
993 EXPECT_FALSE(attempter_.IsAnyUpdateSourceAllowed()); in TEST_F()
999 attempter_.CheckForUpdate("", "autest", true); in TEST_F()
1000 EXPECT_EQ(constants::kOmahaDefaultAUTestURL, attempter_.forced_omaha_url()); in TEST_F()
1006 attempter_.CheckForUpdate("", "autest-scheduled", true); in TEST_F()
1007 EXPECT_EQ(constants::kOmahaDefaultAUTestURL, attempter_.forced_omaha_url()); in TEST_F()