Commit 256e9b07 authored by Saurabh Nijhara's avatar Saurabh Nijhara Committed by Commit Bot

Make test independent of wizard controller state.

The test was based on the assumption that the wizard controller is
recreated in the login display host and hence, had the expectations
according to that. If instead the wizard controller object is reused,
this test fails the expectations set in the test class at the start.
Hence, calling AdvanceToScreen(...) directly instead of going through
login display host.

Bug: 1064271
Change-Id: I12b11f0a08269d91d776ae0e438b7b0b8ce7262d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2132382Reviewed-by: default avatarRoman Sorokin [CET] <rsorokin@chromium.org>
Commit-Queue: Saurabh Nijhara <snijhara@google.com>
Cr-Commit-Position: refs/heads/master@{#756444}
parent 665df47e
...@@ -980,15 +980,22 @@ IN_PROC_BROWSER_TEST_F(WizardControllerFlowTest, ...@@ -980,15 +980,22 @@ IN_PROC_BROWSER_TEST_F(WizardControllerFlowTest,
IN_PROC_BROWSER_TEST_F(WizardControllerFlowTest, IN_PROC_BROWSER_TEST_F(WizardControllerFlowTest,
ControlFlowWrongHWIDScreenFromLogin) { ControlFlowWrongHWIDScreenFromLogin) {
CheckCurrentScreen(WelcomeView::kScreenId); CheckCurrentScreen(WelcomeView::kScreenId);
LoginDisplayHost::default_host()->StartSignInScreen(); LoginDisplayHost::default_host()->StartSignInScreen();
EXPECT_FALSE(ExistingUserController::current_controller() == NULL); EXPECT_FALSE(ExistingUserController::current_controller() == NULL);
ExistingUserController::current_controller()->ShowWrongHWIDScreen();
EXPECT_CALL(*mock_wrong_hwid_screen_, ShowImpl()).Times(1);
EXPECT_CALL(*mock_welcome_screen_, HideImpl()).Times(1);
EXPECT_CALL(*mock_welcome_screen_, SetConfiguration(IsNull())).Times(1);
WizardController::default_controller()->AdvanceToScreen(
WrongHWIDScreenView::kScreenId);
CheckCurrentScreen(WrongHWIDScreenView::kScreenId); CheckCurrentScreen(WrongHWIDScreenView::kScreenId);
// After warning is skipped, user returns to sign-in screen. // After warning is skipped, user returns to sign-in screen.
// And this destroys WizardController. // And this destroys WizardController.
EXPECT_CALL(*mock_wrong_hwid_screen_, HideImpl()).Times(1);
EXPECT_CALL(*mock_welcome_screen_, ShowImpl()).Times(1);
EXPECT_CALL(*mock_welcome_screen_, SetConfiguration(NotNull())).Times(1);
GetWrongHWIDScreen()->OnExit(); GetWrongHWIDScreen()->OnExit();
EXPECT_FALSE(ExistingUserController::current_controller() == NULL); EXPECT_FALSE(ExistingUserController::current_controller() == NULL);
} }
......
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