Commit 417a18b5 authored by Roman Sorokin's avatar Roman Sorokin Committed by Chromium LUCI CQ

CrOS OOBE: Ignore invalid pending screen.

Bug: 1162271
Change-Id: I08ec5ae65ac7b6228752fec11490497bb6a5fa9e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2602284
Auto-Submit: Roman Sorokin [CET] <rsorokin@chromium.org>
Reviewed-by: default avatarRoman Aleksandrov <raleksandrov@google.com>
Commit-Queue: Roman Sorokin [CET] <rsorokin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#844544}
parent 8bf95523
......@@ -21,6 +21,7 @@
#include "chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/update_screen_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/welcome_screen_handler.h"
#include "chrome/browser/ui/webui/signin/signin_utils.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
......@@ -160,4 +161,20 @@ INSTANTIATE_TEST_SUITE_P(All,
testing::Values("update" /* old value */,
"oobe-update" /* actual value */));
// Checks that invalid (not existing) pending screen is handled gracefully.
class InvalidPendingScreenTest : public OobeBaseTest,
public LocalStateMixin::Delegate {
protected:
// LocalStateMixin::Delegate:
void SetUpLocalState() final {
PrefService* prefs = g_browser_process->local_state();
prefs->SetString(prefs::kOobeScreenPending, "not_existing_screen");
}
LocalStateMixin local_state_mixin_{&mixin_host_, this};
};
IN_PROC_BROWSER_TEST_F(InvalidPendingScreenTest, WelcomeScreenShown) {
OobeScreenWaiter(WelcomeView::kScreenId).Wait();
}
} // namespace chromeos
......@@ -472,7 +472,7 @@ void WizardController::AdvanceToScreenAfterHIDDetection(
// Use the saved screen preference from Local State.
const std::string screen_pref =
GetLocalState()->GetString(prefs::kOobeScreenPending);
if (!screen_pref.empty())
if (!screen_pref.empty() && HasScreen(PrefToScreenId(screen_pref)))
actual_first_screen = PrefToScreenId(screen_pref);
else
actual_first_screen = WelcomeView::kScreenId;
......
......@@ -71,6 +71,7 @@
-HidDetectionTest.*
-InitialEnrollmentTest.*
-InterruptedAutoStartEnrollmentTest.*
-InvalidPendingScreenTest.*
-KioskEnrollmentTest.*
-KioskEnterpriseTest.*
-KioskHiddenWebUITest.*
......
......@@ -71,6 +71,7 @@ HidDetectionSkipTest.*
HidDetectionTest.*
InitialEnrollmentTest.*
InterruptedAutoStartEnrollmentTest.*
InvalidPendingScreenTest.*
KioskEnrollmentTest.*
KioskEnterpriseTest.*
KioskHiddenWebUITest.*
......
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