mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-02 17:06:49 +00:00
Merge "Testing to see if using isInStableState is better condition vs getCurrentStableState" into sc-v2-dev
This commit is contained in:
@@ -346,13 +346,19 @@ public abstract class AbstractLauncherUiTest {
|
||||
}
|
||||
|
||||
// Cannot be used in TaplTests between a Tapl call injecting a gesture and a tapl call
|
||||
// expecting
|
||||
// the results of that gesture because the wait can hide flakeness.
|
||||
// expecting the results of that gesture because the wait can hide flakeness.
|
||||
protected void waitForState(String message, Supplier<LauncherState> state) {
|
||||
waitForLauncherCondition(message,
|
||||
launcher -> launcher.getStateManager().getCurrentStableState() == state.get());
|
||||
}
|
||||
|
||||
// Cannot be used in TaplTests between a Tapl call injecting a gesture and a tapl call
|
||||
// expecting the results of that gesture because the wait can hide flakeness.
|
||||
protected void waitForStableState(String message, Supplier<LauncherState> state) {
|
||||
waitForLauncherCondition(message,
|
||||
launcher -> launcher.getStateManager().isInStableState(state.get()));
|
||||
}
|
||||
|
||||
protected void waitForResumed(String message) {
|
||||
waitForLauncherCondition(message, launcher -> launcher.hasBeenResumed());
|
||||
}
|
||||
|
||||
@@ -91,9 +91,9 @@ public class WorkProfileTest extends AbstractLauncherUiTest {
|
||||
public void workTabExists() {
|
||||
mDevice.pressHome();
|
||||
waitForLauncherCondition("Launcher didn't start", Objects::nonNull);
|
||||
waitForState("Launcher internal state didn't switch to Normal", () -> NORMAL);
|
||||
waitForStableState("Launcher internal state didn't switch to Normal", () -> NORMAL);
|
||||
executeOnLauncher(launcher -> launcher.getStateManager().goToState(ALL_APPS));
|
||||
waitForState("Launcher internal state didn't switch to All Apps", () -> ALL_APPS);
|
||||
waitForStableState("Launcher internal state didn't switch to All Apps", () -> ALL_APPS);
|
||||
waitForLauncherCondition("Personal tab is missing",
|
||||
launcher -> launcher.getAppsView().isPersonalTabVisible(),
|
||||
LauncherInstrumentation.WAIT_TIME_MS);
|
||||
|
||||
Reference in New Issue
Block a user