Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1ac5441f authored by Felipe Leme's avatar Felipe Leme
Browse files

Collapses status bar on teardown so it does not affect other tests.

BUG: 30639703

Test: mmm -j32 frameworks/base/packages/Shell && adb install -r -g ${ANDROID_PRODUCT_OUT}/data/app/ShellTests/ShellTests.apk && adb shell am instrument -e class com.android.shell.BugreportReceiverTest -w com.android.shell.tests/android.support.test.runner.AndroidJUnitRunner

Change-Id: I2635439ac0c033d1ad6b4ba545b8d751f5576b72
parent edbaeb81
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -201,7 +201,12 @@ public class BugreportReceiverTest {
    @After
    public void tearDown() throws Exception {
        Log.i(TAG, getName() + ".tearDown()");
        try {
            cancelExistingNotifications();
        } finally {
            // Collapses just in case, so a failure here does not compromise tests on other classes.
            mUiBot.collapseStatusBar();
        }
    }

    @Test
@@ -362,7 +367,7 @@ public class BugreportReceiverTest {
        detailsUi.assertName(NAME);  // Sanity check

        cancelFromNotification();
        mUiBot.closeNotifications();
        mUiBot.collapseStatusBar();

        assertDetailsUiClosed();
        assertServiceNotRunning();
+1 −1
Original line number Diff line number Diff line
@@ -62,7 +62,7 @@ final class UiBot {
        return getObject(text);
    }

    public void closeNotifications() throws Exception {
    public void collapseStatusBar() throws Exception {
        // TODO: mDevice should provide such method..
        StatusBarManager sbm =
                (StatusBarManager) mInstrumentation.getContext().getSystemService("statusbar");