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

Commit 4ea44738 authored by Ben Reich's avatar Ben Reich Committed by Android (Google) Code Review
Browse files

Revert "Remove all instances of file names from ActivityTestJunit4"

This reverts commit c6a2a32e.

Reason for revert: This has also broken git_main

Change-Id: I8784409831e83fa7b48723099dbc4d5acbe07da9
parent c6a2a32e
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -130,9 +130,6 @@ class TestFilesRule(private val skipCreation: Boolean = false) : ExternalResourc
        @JvmField
        val DIR_NAME_1: String = "Dir1"

        @JvmField
        val CHILD_DIR_1: String = "ChildDir1"

        @JvmField
        val FILE_NAME_1: String = "file1.log"

+8 −0
Original line number Diff line number Diff line
@@ -195,6 +195,14 @@ abstract class ActivityTestJunit4<T : Activity?> {
    }

    companion object {
        // Testing files. For custom ones, override initTestFiles().
        const val dirName1 = "Dir1"
        const val childDir1 = "ChildDir1"
        const val fileName1 = "file1.log"
        const val fileName2 = "file12.png"
        const val fileName3 = "anotherFile0.log"
        const val fileName4 = "poodles.text"
        const val fileNameNoRename = "NO_RENAMEfile.txt"
        const val TIMEOUT = 5000
    }
}
+6 −6
Original line number Diff line number Diff line
@@ -63,7 +63,7 @@ public class FilesActivityUiTest extends ActivityTestJunit4<FilesActivity> {
    public final TestFilesRule mTestFilesRule =
            new TestFilesRule()
                    .createFolderInRoot(ROOT_0_ID, TestFilesRule.DIR_NAME_1)
                    .createFolderWithParent(TestFilesRule.DIR_NAME_1, TestFilesRule.CHILD_DIR_1)
                    .createFolderWithParent(TestFilesRule.DIR_NAME_1, "ChildDir1")
                    .createFileInRoot(ROOT_0_ID, "file0.log", "text/plain")
                    .createFileInRoot(ROOT_0_ID, "file1.png", "image/png")
                    .createFileInRoot(ROOT_0_ID, "file2.csv", "text/csv")
@@ -179,15 +179,15 @@ public class FilesActivityUiTest extends ActivityTestJunit4<FilesActivity> {

    @Test
    public void testNavigate_byBreadcrumb() throws Exception {
        bots.directory.openDocument(TestFilesRule.DIR_NAME_1);
        bots.directory.waitForDocument(TestFilesRule.CHILD_DIR_1);  // wait for known content
        bots.directory.assertDocumentsPresent(TestFilesRule.CHILD_DIR_1);
        bots.directory.openDocument(dirName1);
        bots.directory.waitForDocument(childDir1);  // wait for known content
        bots.directory.assertDocumentsPresent(childDir1);

        device.waitForIdle();
        bots.breadcrumb.assertItemsPresent(TestFilesRule.DIR_NAME_1, "TEST_ROOT_0");
        bots.breadcrumb.assertItemsPresent(dirName1, "TEST_ROOT_0");

        bots.breadcrumb.clickItem("TEST_ROOT_0");
        bots.directory.waitForDocument(TestFilesRule.DIR_NAME_1);
        bots.directory.waitForDocument(dirName1);
    }

    @Test
+1 −1
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ public class FingerSelectionUiTest extends ActivityTestJunit4<FilesActivity> {
    public void testFingerSelection_outOfRange() throws Exception {
        bots.main.switchToGridMode();
        Rect dirListBounds = bots.directory.findDocumentsList().getBounds();
        Rect firstDoc = bots.directory.findDocument(TestFilesRule.FILE_NAME_1).getBounds();
        Rect firstDoc = bots.directory.findDocument(fileName1).getBounds();
        // Start from list right bottom.
        Point start = new Point(firstDoc.centerX(), firstDoc.centerY());
        // End is center of file1
+4 −4
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ public class GestureSelectionUiTest extends ActivityTestJunit4<FilesActivity> {
    @Test
    public void testGridGestureSelect_twoFiles() throws Exception {
        bots.main.switchToGridMode();
        bots.gesture.gestureSelectFiles(TestFilesRule.FILE_NAME_1, TestFilesRule.FILE_NAME_2);
        bots.gesture.gestureSelectFiles(fileName1, fileName2);

        bots.directory.assertSelection(2);
    }
@@ -47,7 +47,7 @@ public class GestureSelectionUiTest extends ActivityTestJunit4<FilesActivity> {
    @Test
    public void testGridGestureSelect_multipleFiles() throws Exception {
        bots.main.switchToGridMode();
        bots.gesture.gestureSelectFiles(TestFilesRule.FILE_NAME_2, TestFilesRule.DIR_NAME_1);
        bots.gesture.gestureSelectFiles(fileName2, dirName1);

        bots.directory.assertSelection(3);

@@ -56,7 +56,7 @@ public class GestureSelectionUiTest extends ActivityTestJunit4<FilesActivity> {
    @Test
    public void testListGestureSelect_twoFiles() throws Exception {
        bots.main.switchToListMode();
        bots.gesture.gestureSelectFiles(TestFilesRule.FILE_NAME_1, TestFilesRule.FILE_NAME_2);
        bots.gesture.gestureSelectFiles(fileName1, fileName2);

        bots.directory.assertSelection(2);

@@ -65,7 +65,7 @@ public class GestureSelectionUiTest extends ActivityTestJunit4<FilesActivity> {
    @Test
    public void testListGestureSelect_multipleFiles() throws Exception {
        bots.main.switchToListMode();
        bots.gesture.gestureSelectFiles(TestFilesRule.FILE_NAME_2, TestFilesRule.DIR_NAME_1);
        bots.gesture.gestureSelectFiles(fileName2, dirName1);

        bots.directory.assertSelection(3);

Loading