Improve diags when system errors cause failing Launcher tests

Now, for example, we won't diagnose a locked phone as a
"home button not showing in 3-button mode", even though it's technically
correct.

Change-Id: Ibdfa0741af7ff8545a811f6702dda74dc6c31c2e
This commit is contained in:
vadimt
2019-11-04 14:50:22 -08:00
parent 43968167d9
commit 137f5b62ac
7 changed files with 43 additions and 32 deletions

View File

@@ -26,8 +26,6 @@ import static org.junit.Assert.assertTrue;
import static java.lang.System.exit;
import static androidx.test.InstrumentationRegistry.getInstrumentation;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.ContentResolver;
@@ -306,7 +304,7 @@ public abstract class AbstractLauncherUiTest {
protected void waitForLauncherCondition(
String message, Function<Launcher, Boolean> condition, long timeout) {
if (!TestHelpers.isInLauncherProcess()) return;
Wait.atMost(message, () -> getFromLauncher(condition), timeout);
Wait.atMost(message, () -> getFromLauncher(condition), timeout, mLauncher);
}
// Cannot be used in TaplTests after injecting any gesture using Tapl because this can hide
@@ -319,7 +317,7 @@ public abstract class AbstractLauncherUiTest {
final Object fromLauncher = getFromLauncher(f);
output[0] = fromLauncher;
return fromLauncher != null;
}, timeout);
}, timeout, mLauncher);
return (T) output[0];
}
@@ -333,7 +331,7 @@ public abstract class AbstractLauncherUiTest {
Wait.atMost(message, () -> {
testThreadAction.run();
return getFromLauncher(condition);
}, timeout);
}, timeout, mLauncher);
}
protected LauncherActivityInfo getSettingsApp() {