0

Add unittest for modal dialog in It2MeConfirmationDialogChromeOS

[Part 2]

Add test for modal dialog when it is shown and the following action
takes place:
* User signs in.
* User logs out.
* The device is locked.
* The device is unlocked.

Bug: b:394766668
Change-Id: I9b5560f27a13cdae1a35cfb47cf62097bb8585b7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6244458
Reviewed-by: Jeroen Dhollander <jeroendh@google.com>
Commit-Queue: Ashutosh Singhal <macinashutosh@google.com>
Reviewed-by: Joe Downing <joedow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1418261}
This commit is contained in:
Ashutosh Singhal
2025-02-10 10:48:29 -08:00
committed by Chromium LUCI CQ
parent f84aa39c24
commit 0802c52cbb

@ -299,6 +299,66 @@ TEST_P(It2MeConfirmationDialogChromeOSTestWithCrdUnattendedEnabled,
ASSERT_TRUE(DialogVisibleInParentContainer(kUserSessionScreen));
}
TEST_P(It2MeConfirmationDialogChromeOSTestWithCrdUnattendedEnabled,
DialogShouldMoveToUserSessionScreenOnUserLogin) {
SimulateDeviceOnLoginScreen();
CreateAndShowDialog(kTestingRemoteEmail, DoNothingCallback());
ASSERT_TRUE(DialogVisibleInParentContainer(kLoginScreen));
ASSERT_FALSE(DialogVisibleInParentContainer(kUserSessionScreen));
SimulateUserLogin(kTestUserEmail, user_manager::UserType::kRegular);
ASSERT_FALSE(DialogVisibleInParentContainer(kLoginScreen));
ASSERT_TRUE(DialogVisibleInParentContainer(kUserSessionScreen));
}
TEST_P(It2MeConfirmationDialogChromeOSTestWithCrdUnattendedEnabled,
DialogShouldMoveToLoginScreenOnUserLogout) {
SimulateUserLogin(kTestUserEmail, user_manager::UserType::kRegular);
CreateAndShowDialog(kTestingRemoteEmail, DoNothingCallback());
ASSERT_TRUE(DialogVisibleInParentContainer(kUserSessionScreen));
ASSERT_FALSE(DialogVisibleInParentContainer(kLoginScreen));
ClearLogin();
ASSERT_FALSE(DialogVisibleInParentContainer(kUserSessionScreen));
ASSERT_TRUE(DialogVisibleInParentContainer(kLoginScreen));
}
TEST_P(It2MeConfirmationDialogChromeOSTestWithCrdUnattendedEnabled,
DialogShouldMoveToUserSessionScreenOnSessionUnlock) {
SimulateDeviceOnLockScreen();
CreateAndShowDialog(kTestingRemoteEmail, DoNothingCallback());
ASSERT_TRUE(DialogVisibleInParentContainer(kLockScreen));
ASSERT_FALSE(DialogVisibleInParentContainer(kUserSessionScreen));
SimulateUserLogin(kTestUserEmail, user_manager::UserType::kRegular);
ASSERT_FALSE(DialogVisibleInParentContainer(kLockScreen));
ASSERT_TRUE(DialogVisibleInParentContainer(kUserSessionScreen));
}
TEST_P(It2MeConfirmationDialogChromeOSTestWithCrdUnattendedEnabled,
DialogShouldMoveToLockSessionScreenWhenSessionIsLocked) {
SimulateUserLogin(kTestUserEmail, user_manager::UserType::kRegular);
CreateAndShowDialog(kTestingRemoteEmail, DoNothingCallback());
ASSERT_TRUE(DialogVisibleInParentContainer(kUserSessionScreen));
ASSERT_FALSE(DialogVisibleInParentContainer(kLockScreen));
SimulateDeviceOnLockScreen();
ASSERT_FALSE(DialogVisibleInParentContainer(kUserSessionScreen));
ASSERT_TRUE(DialogVisibleInParentContainer(kLockScreen));
}
INSTANTIATE_TEST_SUITE_P(EnterpriseDialog,
It2MeConfirmationDialogChromeOSTest,
testing::Values(DialogStyle::kEnterprise));