Loading tests/common/com/android/documentsui/rules/TestFilesRule.kt +3 −0 Original line number Diff line number Diff line Loading @@ -130,6 +130,9 @@ 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" Loading tests/functional/com/android/documentsui/ActivityTestJunit4.kt +0 −8 Original line number Diff line number Diff line Loading @@ -194,14 +194,6 @@ 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 } } tests/functional/com/android/documentsui/ContextMenuUiTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -108,7 +108,7 @@ public class ContextMenuUiTest extends ActivityTestJunit4<FilesActivity> { menuItems.put("Select all", true); menuItems.put("New folder", true); Rect dirListBounds = bots.directory.findDocumentsList().getBounds(); Rect dirBounds = bots.directory.findDocument(dirName1).getBounds(); Rect dirBounds = bots.directory.findDocument(TestFilesRule.DIR_NAME_1).getBounds(); bots.main.switchToGridMode(); // right side of dir1 area Loading tests/functional/com/android/documentsui/FilesActivityUiTest.java +6 −6 Original line number Diff line number Diff line Loading @@ -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, "ChildDir1") .createFolderWithParent(TestFilesRule.DIR_NAME_1, TestFilesRule.CHILD_DIR_1) .createFileInRoot(ROOT_0_ID, "file0.log", "text/plain") .createFileInRoot(ROOT_0_ID, "file1.png", "image/png") .createFileInRoot(ROOT_0_ID, "file2.csv", "text/csv") Loading Loading @@ -179,15 +179,15 @@ public class FilesActivityUiTest extends ActivityTestJunit4<FilesActivity> { @Test public void testNavigate_byBreadcrumb() throws Exception { bots.directory.openDocument(dirName1); bots.directory.waitForDocument(childDir1); // wait for known content bots.directory.assertDocumentsPresent(childDir1); 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); device.waitForIdle(); bots.breadcrumb.assertItemsPresent(dirName1, "TEST_ROOT_0"); bots.breadcrumb.assertItemsPresent(TestFilesRule.DIR_NAME_1, "TEST_ROOT_0"); bots.breadcrumb.clickItem("TEST_ROOT_0"); bots.directory.waitForDocument(dirName1); bots.directory.waitForDocument(TestFilesRule.DIR_NAME_1); } @Test Loading tests/functional/com/android/documentsui/FingerSelectionUiTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -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(fileName1).getBounds(); Rect firstDoc = bots.directory.findDocument(TestFilesRule.FILE_NAME_1).getBounds(); // Start from list right bottom. Point start = new Point(firstDoc.centerX(), firstDoc.centerY()); // End is center of file1 Loading Loading
tests/common/com/android/documentsui/rules/TestFilesRule.kt +3 −0 Original line number Diff line number Diff line Loading @@ -130,6 +130,9 @@ 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" Loading
tests/functional/com/android/documentsui/ActivityTestJunit4.kt +0 −8 Original line number Diff line number Diff line Loading @@ -194,14 +194,6 @@ 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 } }
tests/functional/com/android/documentsui/ContextMenuUiTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -108,7 +108,7 @@ public class ContextMenuUiTest extends ActivityTestJunit4<FilesActivity> { menuItems.put("Select all", true); menuItems.put("New folder", true); Rect dirListBounds = bots.directory.findDocumentsList().getBounds(); Rect dirBounds = bots.directory.findDocument(dirName1).getBounds(); Rect dirBounds = bots.directory.findDocument(TestFilesRule.DIR_NAME_1).getBounds(); bots.main.switchToGridMode(); // right side of dir1 area Loading
tests/functional/com/android/documentsui/FilesActivityUiTest.java +6 −6 Original line number Diff line number Diff line Loading @@ -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, "ChildDir1") .createFolderWithParent(TestFilesRule.DIR_NAME_1, TestFilesRule.CHILD_DIR_1) .createFileInRoot(ROOT_0_ID, "file0.log", "text/plain") .createFileInRoot(ROOT_0_ID, "file1.png", "image/png") .createFileInRoot(ROOT_0_ID, "file2.csv", "text/csv") Loading Loading @@ -179,15 +179,15 @@ public class FilesActivityUiTest extends ActivityTestJunit4<FilesActivity> { @Test public void testNavigate_byBreadcrumb() throws Exception { bots.directory.openDocument(dirName1); bots.directory.waitForDocument(childDir1); // wait for known content bots.directory.assertDocumentsPresent(childDir1); 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); device.waitForIdle(); bots.breadcrumb.assertItemsPresent(dirName1, "TEST_ROOT_0"); bots.breadcrumb.assertItemsPresent(TestFilesRule.DIR_NAME_1, "TEST_ROOT_0"); bots.breadcrumb.clickItem("TEST_ROOT_0"); bots.directory.waitForDocument(dirName1); bots.directory.waitForDocument(TestFilesRule.DIR_NAME_1); } @Test Loading
tests/functional/com/android/documentsui/FingerSelectionUiTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -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(fileName1).getBounds(); Rect firstDoc = bots.directory.findDocument(TestFilesRule.FILE_NAME_1).getBounds(); // Start from list right bottom. Point start = new Point(firstDoc.centerX(), firstDoc.centerY()); // End is center of file1 Loading