From 160c8217d574258716a778d76fcc072eb04334f7 Mon Sep 17 00:00:00 2001 From: vadimt Date: Thu, 6 Apr 2023 15:52:53 -0700 Subject: [PATCH] Failing all e2e tests after seeing a lock screen without additional checks for the lock screen This will speed up the tests. Test: presubmit Bug: 276755129 Change-Id: I7170ea76d3e013a8b55187432809815c3713e6c7 --- .../android/launcher3/ui/AbstractLauncherUiTest.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java index 4f6cc64a47..cefba16980 100644 --- a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java +++ b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java @@ -106,6 +106,8 @@ public abstract class AbstractLauncherUiTest { private static boolean sDumpWasGenerated = false; private static boolean sActivityLeakReported = false; + private static boolean sSeenKeygard = false; + private static final String SYSTEMUI_PACKAGE = "com.android.systemui"; protected LooperExecutor mMainThreadExecutor = MAIN_EXECUTOR; @@ -237,9 +239,13 @@ public abstract class AbstractLauncherUiTest { @Before public void setUp() throws Exception { mLauncher.onTestStart(); - Assert.assertTrue("Keyguard is visible, which is likely caused by a crash in SysUI", - TestHelpers.wait( - Until.gone(By.res(SYSTEMUI_PACKAGE, "keyguard_status_view")), 60000)); + + 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", + sSeenKeygard); final String launcherPackageName = mDevice.getLauncherPackageName(); try {