From 2e1d2c32ed1b0f774a494c6dd6f033df3f6193d7 Mon Sep 17 00:00:00 2001 From: vadimt Date: Thu, 20 Apr 2023 14:14:23 -0700 Subject: [PATCH] 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 --- .../com/android/launcher3/ui/AbstractLauncherUiTest.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java index cefba16980..3141c7ba12 100644 --- a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java +++ b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java @@ -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();