Commit 9c5f9059 authored by Saurabh Nijhara's avatar Saurabh Nijhara Committed by Commit Bot

Update required screen appears with no rendering of UI.

onBeforeShow() of checking-downloading-update element is not being
called due to which the oobe dialogs contained inside it are not
being rendered because these dialogs use lazy rendering in
OnBeforeShow() of the oobe dialog. This creates a situation with no
UI element on the screen but the update process running in the
background. Now, calling onbeforeShow() for this element from the
defaultControl() of update required screen.
This CL also adds a test to avoid such case in future. It tests
the update process along with the verification of the UI actually
being displayed.

Bug: 1048607
Change-Id: Ib1ac1c8d935ec059e62202095e7009f89e98a900
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2146901Reviewed-by: default avatarDenis Kuznetsov [CET] <antrim@chromium.org>
Reviewed-by: default avatarRoman Sorokin [CET] <rsorokin@chromium.org>
Commit-Queue: Saurabh Nijhara <snijhara@google.com>
Cr-Commit-Position: refs/heads/master@{#759244}
parent 8dd34441
......@@ -47,6 +47,13 @@ constexpr char KMeteredNetworkAcceptButton[] =
"cellular-permission-accept-button";
constexpr char KNoNetworkDialog[] = "update-required-no-network-dialog";
// Elements in checking-downloading-update
constexpr char kUpdateProcessChecking[] = "checking-for-updates-dialog";
constexpr char kUpdateProcessUpdating[] = "updating-dialog";
constexpr char kUpdateProcessComplete[] = "update-complete-dialog";
constexpr char kCheckingForUpdatesMessage[] = "checkingForUpdatesMsg";
constexpr char kUpdatingProgress[] = "updating-progress";
constexpr char kWifiServicePath[] = "/service/wifi2";
constexpr char kCellularServicePath[] = "/service/cellular1";
......@@ -409,4 +416,55 @@ IN_PROC_BROWSER_TEST_F(UpdateRequiredScreenTest,
EXPECT_EQ(1, fake_update_engine_client_->reboot_after_update_call_count());
}
// This tests the update process initiated from update required screen.
IN_PROC_BROWSER_TEST_F(UpdateRequiredScreenTest, TestUpdateProcess) {
// Wifi is connected, show update required screen.
ShowUpdateRequiredScreen();
test::OobeJS().ExpectVisiblePath(
{kUpdateRequiredScreen, kUpdateRequiredDialog});
// Click to start update process.
test::OobeJS().ClickOnPath(
{kUpdateRequiredScreen, kUpdateRequiredUpdateButton});
test::OobeJS()
.CreateVisibilityWaiter(true, {kUpdateRequiredScreen, kUpdateProcess})
->Wait();
test::OobeJS().ExpectHiddenPath(
{kUpdateRequiredScreen, kUpdateRequiredDialog});
SetUpdateEngineStatus(update_engine::Operation::CHECKING_FOR_UPDATE);
// Wait for the content of the dialog to be rendered.
test::OobeJS()
.CreateDisplayedWaiter(true, {kUpdateRequiredScreen, kUpdateProcess,
kCheckingForUpdatesMessage})
->Wait();
test::OobeJS().ExpectVisiblePath(
{kUpdateRequiredScreen, kUpdateProcess, kUpdateProcessChecking});
test::OobeJS().ExpectHiddenPath(
{kUpdateRequiredScreen, kUpdateProcess, kUpdateProcessUpdating});
test::OobeJS().ExpectHiddenPath(
{kUpdateRequiredScreen, kUpdateProcess, kUpdateProcessComplete});
SetUpdateEngineStatus(update_engine::Operation::DOWNLOADING);
// Wait for the content of the dialog to be rendered.
test::OobeJS()
.CreateDisplayedWaiter(
true, {kUpdateRequiredScreen, kUpdateProcess, kUpdatingProgress})
->Wait();
test::OobeJS().ExpectHiddenPath(
{kUpdateRequiredScreen, kUpdateProcess, kUpdateProcessChecking});
SetUpdateEngineStatus(update_engine::Operation::UPDATED_NEED_REBOOT);
test::OobeJS()
.CreateVisibilityWaiter(
true, {kUpdateRequiredScreen, kUpdateProcess, kUpdateProcessComplete})
->Wait();
test::OobeJS().ExpectHiddenPath(
{kUpdateRequiredScreen, kUpdateProcess, kUpdateProcessUpdating});
// UpdateStatusChanged(status) calls RebootAfterUpdate().
EXPECT_EQ(1, fake_update_engine_client_->reboot_after_update_call_count());
}
} // namespace chromeos
......@@ -36,6 +36,14 @@ Polymer({
ui_state: {type: String},
},
onBeforeShow() {
this.behaviors.forEach((behavior) => {
if (behavior.onBeforeShow)
behavior.onBeforeShow.call(this);
});
this.$['checking-downloading-update'].onBeforeShow();
},
/** Called after resources are updated. */
updateLocalizedContent() {
this.i18nUpdateLocale();
......
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