Making it clear that a test sees the keyguard for the first time.

This help to find a test which bugreport may still contain a recent crash in SysUI. This is the tests that prints "for the first time = true"

Test: presubmit
Bug: 187761685
Change-Id: Ic24a1d6f4ba36e117df2166c57bbc0a1d021cc7d
This commit is contained in:
vadimt
2023-04-20 14:14:23 -07:00
parent 3e3d3e78a0
commit 2e1d2c32ed

View File

@@ -240,11 +240,16 @@ public abstract class AbstractLauncherUiTest {
public void setUp() throws Exception {
mLauncher.onTestStart();
final boolean keyguardAlreadyVisible = sSeenKeygard;
sSeenKeygard = sSeenKeygard
|| !TestHelpers.wait(
Until.gone(By.res(SYSTEMUI_PACKAGE, "keyguard_status_view")), 60000);
Assert.assertFalse("Keyguard is visible, which is likely caused by a crash in SysUI",
Assert.assertFalse(
"Keyguard is visible, which is likely caused by a crash in SysUI, seeing keyguard"
+ " for the first time = "
+ !keyguardAlreadyVisible,
sSeenKeygard);
final String launcherPackageName = mDevice.getLauncherPackageName();