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:
1 parent
43968167d9
commit
137f5b62ac
7 files changed
+43
-32
No files matched your search
@@ -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() {
|
||||
|
||||
Reference in new issue
Block a user