Unifying setup for AOSP and Nexus Tapl Tests

Test: TaplTestsQS
Change-Id: Ib699566f13980bd89335ad17b2a694e37b83e2ae
This commit is contained in:
vadimt 2019-02-15 12:08:19 -08:00
parent 0589b07829
commit e12f5c3b8b
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.