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

Commit 88f952f4 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Attempt at fixing broken tests and regressing performance."

parents 096e4a06 8c3e68d3
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -56,6 +56,10 @@ public class FilesJankPerfTest extends JankTestBase {
        final Intent intent = new Intent(context, FilesActivity.class);
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        mActivity = getInstrumentation().startActivitySync(intent);
        try {
            device.setOrientationNatural();
        } catch (RemoteException e) {
        }
    }

    public void tearDownInLoop() {
@@ -63,6 +67,11 @@ public class FilesJankPerfTest extends JankTestBase {
            mActivity.finish();
            mActivity = null;
        }
        try {
            final UiDevice device = UiDevice.getInstance(getInstrumentation());
            device.unfreezeRotation();
        } catch (RemoteException e) {
        }
    }

    public void setupAndOpenInLoop() throws Exception {
+9 −12
Original line number Diff line number Diff line
@@ -67,17 +67,6 @@ public class FileManagementUiTest extends ActivityTest<FilesActivity> {
        bots.directory.waitForDocument("Kung Fu Panda");
    }

    public void testDeleteDocument() throws Exception {
        bots.directory.clickDocument("file1.png");
        device.waitForIdle();
        bots.main.clickToolbarItem(R.id.menu_delete);

        bots.main.clickDialogOkButton();
        device.waitForIdle();

        bots.directory.assertDocumentsAbsent("file1.png");
    }

    public void testKeyboard_CutDocument() throws Exception {
        bots.directory.clickDocument("file1.png");
        device.waitForIdle();
@@ -111,7 +100,7 @@ public class FileManagementUiTest extends ActivityTest<FilesActivity> {
        bots.directory.waitForDocument("file1.png");
    }

    public void testDeleteDocument_Cancel() throws Exception {
    public void testDeleteDocument_Cancel_ThenOK() throws Exception {
        bots.directory.clickDocument("file1.png");
        device.waitForIdle();
        bots.main.clickToolbarItem(R.id.menu_delete);
@@ -119,5 +108,13 @@ public class FileManagementUiTest extends ActivityTest<FilesActivity> {
        bots.main.clickDialogCancelButton();

        bots.directory.waitForDocument("file1.png");

        device.waitForIdle();
        bots.main.clickToolbarItem(R.id.menu_delete);

        bots.main.clickDialogOkButton();
        device.waitForIdle();

        bots.directory.assertDocumentsAbsent("file1.png");
    }
}