Commit bd438423 authored by Andrey Zaytsev's avatar Andrey Zaytsev Committed by Commit Bot

Safety check: fixed updater DISABLED state to not need a new JS state

This CL is needed to land https://crrev.com/c/2160745 on the M83 branch. For more context see that CL.

Bug: 1072432, 1015841
Change-Id: I7284f92d8db2c60fe7209b215b71c26e45770ef7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2162925Reviewed-by: default avatarMartin Šrámek <msramek@chromium.org>
Reviewed-by: default avatarEsmael Elmoslimany <aee@chromium.org>
Commit-Queue: Esmael Elmoslimany <aee@chromium.org>
Auto-Submit: Andrey Zaytsev <andzaytsev@google.com>
Cr-Commit-Position: refs/heads/master@{#761970}
parent 346f81f8
......@@ -263,9 +263,14 @@ void SafetyCheckHandler::OnUpdateCheckResult(VersionUpdater::Status status,
base::UmaHistogramEnumeration("Settings.SafetyCheck.UpdatesResult",
update_status_);
}
FireBasicSafetyCheckWebUiListener(kUpdatesEvent,
static_cast<int>(update_status_),
GetStringForUpdates(update_status_));
// TODO(crbug/1072432): Since the UNKNOWN state is not present in JS in M83,
// use FAILED_OFFLINE, which uses the same icon.
FireBasicSafetyCheckWebUiListener(
kUpdatesEvent,
static_cast<int>(update_status_ != UpdateStatus::kUnknown
? update_status_
: UpdateStatus::kFailedOffline),
GetStringForUpdates(update_status_));
CompleteParentIfChildrenCompleted();
}
......
......@@ -372,10 +372,12 @@ TEST_F(SafetyCheckHandlerTest, CheckUpdates_Relaunch) {
TEST_F(SafetyCheckHandlerTest, CheckUpdates_Disabled) {
version_updater_->SetReturnedStatus(VersionUpdater::Status::DISABLED);
safety_check_->PerformSafetyCheck();
// TODO(crbug/1072432): Since the UNKNOWN state is not present in JS in M83,
// use FAILED_OFFLINE, which uses the same icon.
const base::DictionaryValue* event =
GetSafetyCheckStatusChangedWithDataIfExists(
kUpdates,
static_cast<int>(SafetyCheckHandler::UpdateStatus::kUnknown));
static_cast<int>(SafetyCheckHandler::UpdateStatus::kFailedOffline));
ASSERT_TRUE(event);
VerifyDisplayString(
event, "Version " + version_info::GetVersionNumber() + " (" +
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment