Merge "Unifying setup for AOSP and Nexus Tapl Tests" into ub-launcher3-master

This commit is contained in:
Vadim Tryshev 2019-02-15 20:33:08 +00:00 committed by Android (Google) Code Review
commit 266415f11e
2 changed files with 9 additions and 12 deletions

View File

@ -55,12 +55,7 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest {
@Before
public void setUp() throws Exception {
super.setUp();
clearLauncherData();
mLauncher.pressHome();
waitForState("Launcher internal state didn't switch to Home", LauncherState.NORMAL);
waitForResumed("Launcher internal state is still Background");
TaplTestsLauncher3.initialize(this);
}
private void startTestApps() throws Exception {

View File

@ -104,13 +104,15 @@ public class TaplTestsLauncher3 extends AbstractLauncherUiTest {
@Before
public void setUp() throws Exception {
super.setUp();
initialize(this);
}
clearLauncherData();
mDevice.pressHome();
waitForLauncherCondition("Launcher didn't start", launcher -> launcher != null);
waitForState("Launcher internal state didn't switch to Home", LauncherState.NORMAL);
waitForResumed("Launcher internal state is still Background");
public static void initialize(AbstractLauncherUiTest test) throws Exception {
test.clearLauncherData();
test.mDevice.pressHome();
test.waitForLauncherCondition("Launcher didn't start", launcher -> launcher != null);
test.waitForState("Launcher internal state didn't switch to Home", LauncherState.NORMAL);
test.waitForResumed("Launcher internal state is still Background");
}
// Please don't add negative test cases for methods that fail only after a long wait.