Skip to content

Commit

Permalink
Use a new message for roll_forward update (#4623)
Browse files Browse the repository at this point in the history
This new messages distinguishes the roll_forward state from the newly
installed update state. This is useful for the YTS tests to verify the
correct updater states.

b/382561808

Change-Id: I829c490ba22a2fbfe03276864ebdc6e0350ba243
  • Loading branch information
yuying-y authored Dec 23, 2024
1 parent 974ad46 commit 6d6386c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions chrome/updater/updater_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,11 @@ void Observer::OnEvent(Events event, const std::string& id) {
updater_status_string_map.find(status_iterator->second)->second);
}
if (crx_update_item_.state == ComponentState::kUpdateError) {
// QUICK_ROLL_FORWARD update, adjust the message to "Update installed,
// QUICK_ROLL_FORWARD update, adjust the message to "Updated locally,
// pending restart"
if (crx_update_item_.error_code == static_cast<int>(UpdateCheckError::QUICK_ROLL_FORWARD)) {
status = std::string(
updater_status_string_map.at(UpdaterStatus::kUpdated));
updater_status_string_map.at(UpdaterStatus::kRolledForward));
} else {
status +=
", error category is " + std::to_string(static_cast<int>(crx_update_item_.error_category)) +
Expand Down
2 changes: 2 additions & 0 deletions chrome/updater/updater_module.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ enum class UpdaterStatus {
kUpdatingDiff,
kUpdating,
kUpdated,
kRolledForward,
kUpToDate,
kUpdateError,
kUninstalled,
Expand Down Expand Up @@ -83,6 +84,7 @@ const std::map<UpdaterStatus, const char*> updater_status_string_map = {
{UpdaterStatus::kUpdatingDiff, "Installing delta update"},
{UpdaterStatus::kUpdating, "Installing update"},
{UpdaterStatus::kUpdated, "Update installed, pending restart"},
{UpdaterStatus::kRolledForward, "Updated locally, pending restart"},
{UpdaterStatus::kUpToDate, "App is up to date"},
{UpdaterStatus::kUpdateError, "Failed to update"},
{UpdaterStatus::kUninstalled, "Update uninstalled"},
Expand Down

0 comments on commit 6d6386c

Please sign in to comment.