Avoid confusing errors "Launcher pid should be 0" when test setup fails
Change-Id: Ic5e8114a0f86d1a08738785c4098645e59a24975
This commit is contained in:
@@ -56,6 +56,7 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest {
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
mLauncherPid = 0;
|
||||
super.setUp();
|
||||
TaplTestsLauncher3.initialize(this);
|
||||
mLauncherPid = mLauncher.getPid();
|
||||
@@ -63,7 +64,9 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest {
|
||||
|
||||
@After
|
||||
public void teardown() {
|
||||
assertEquals("Launcher crashed, pid mismatch:", mLauncherPid, mLauncher.getPid());
|
||||
if (mLauncherPid != 0) {
|
||||
assertEquals("Launcher crashed, pid mismatch:", mLauncherPid, mLauncher.getPid());
|
||||
}
|
||||
}
|
||||
|
||||
private void startTestApps() throws Exception {
|
||||
|
||||
@@ -59,6 +59,7 @@ public class TaplTestsLauncher3 extends AbstractLauncherUiTest {
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
mLauncherPid = 0;
|
||||
super.setUp();
|
||||
initialize(this);
|
||||
mLauncherPid = mLauncher.getPid();
|
||||
@@ -66,7 +67,9 @@ public class TaplTestsLauncher3 extends AbstractLauncherUiTest {
|
||||
|
||||
@After
|
||||
public void teardown() {
|
||||
assertEquals("Launcher crashed, pid mismatch:", mLauncherPid, mLauncher.getPid());
|
||||
if (mLauncherPid != 0) {
|
||||
assertEquals("Launcher crashed, pid mismatch:", mLauncherPid, mLauncher.getPid());
|
||||
}
|
||||
}
|
||||
|
||||
public static void initialize(AbstractLauncherUiTest test) throws Exception {
|
||||
@@ -120,7 +123,7 @@ public class TaplTestsLauncher3 extends AbstractLauncherUiTest {
|
||||
mDevice.pressMenu();
|
||||
mDevice.waitForIdle();
|
||||
mLauncher.getOptionsPopupMenu().getMenuItem("Home settings")
|
||||
.launch(mDevice.getLauncherPackageName());
|
||||
.launch(mDevice.getLauncherPackageName());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user