Loading res/values/strings.xml +1 −1 Original line number Diff line number Diff line Loading @@ -326,7 +326,7 @@ <string name="name_conflict">A file with this name already exists.</string> <!-- Error message shown when more authentication is necessary to view files --> <string name="authentication_required">Authentification is required to see the content of this directory</string> <string name="authentication_required">Authentication is required to see the content of this directory</string> <!-- Text shown on button to open an application --> <string name="open_app">Open <xliff:g id="name" example="Cloud Storage">%1$s</xliff:g></string> Loading tests/common/com/android/documentsui/bots/DirectoryListBot.java +21 −3 Original line number Diff line number Diff line Loading @@ -103,16 +103,34 @@ public class DirectoryListBot extends Bots.BaseBot { } } public void assertMessageTextView(String message) throws UiObjectNotFoundException { UiObject messageTextView = findMessageTextView(); public void assertHeaderMessageText(String message) throws UiObjectNotFoundException { UiObject messageTextView = findHeaderMessageTextView(); assertTrue(messageTextView.exists()); String msg = String.valueOf(message); assertEquals(msg, messageTextView.getText()); } /** * Checks against placeholder text. Placeholder can be Empty page, No results page, or the * "Hourglass" page (ie. something-went-wrong page). */ public void assertPlaceholderMessageText(String message) throws UiObjectNotFoundException { UiObject messageTextView = findPlaceholderMessageTextView(); assertTrue(messageTextView.exists()); String msg = String.valueOf(message); assertEquals(msg, messageTextView.getText()); } private UiObject findHeaderMessageTextView() { return findObject( DIR_CONTAINER_ID, "com.android.documentsui:id/message_textview"); } private UiObject findMessageTextView() { private UiObject findPlaceholderMessageTextView() { return findObject( DIR_CONTAINER_ID, "com.android.documentsui:id/message"); Loading tests/functional/com/android/documentsui/ArchiveUiTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -40,6 +40,6 @@ public class ArchiveUiTest extends ActivityTest<FilesActivity> { bots.directory.openDocument("broken.zip"); final String msg = String.valueOf(context.getString(R.string.empty)); bots.directory.assertMessageTextView(msg); bots.directory.assertPlaceholderMessageText(msg); } } tests/functional/com/android/documentsui/FilesActivityDefaultsUiTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -61,7 +61,7 @@ public class FilesActivityDefaultsUiTest extends ActivityTest<FilesActivity> { bots.roots.openRoot(rootDir0.title); String msg = String.valueOf(context.getString(R.string.empty)); bots.directory.assertMessageTextView(msg); bots.directory.assertPlaceholderMessageText(msg); // Check to make sure back button is properly handled by non-Doc type DocHolders device.pressBack(); Loading tests/functional/com/android/documentsui/FilesActivityUiTest.java +9 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,15 @@ public class FilesActivityUiTest extends ActivityTest<FilesActivity> { bots.main.assertWindowTitle("Images"); } public void testProtectedFolder_showsAuthenticationUi() throws Exception { bots.roots.openRoot("Demo Root"); bots.main.switchToListMode(); bots.directory.openDocument("throw a recoverable exception"); bots.directory.assertHeaderMessageText( "Authentication is required to see the content of this directory"); } public void testFilesListed() throws Exception { bots.directory.assertDocumentsPresent("file0.log", "file1.png", "file2.csv"); } Loading Loading
res/values/strings.xml +1 −1 Original line number Diff line number Diff line Loading @@ -326,7 +326,7 @@ <string name="name_conflict">A file with this name already exists.</string> <!-- Error message shown when more authentication is necessary to view files --> <string name="authentication_required">Authentification is required to see the content of this directory</string> <string name="authentication_required">Authentication is required to see the content of this directory</string> <!-- Text shown on button to open an application --> <string name="open_app">Open <xliff:g id="name" example="Cloud Storage">%1$s</xliff:g></string> Loading
tests/common/com/android/documentsui/bots/DirectoryListBot.java +21 −3 Original line number Diff line number Diff line Loading @@ -103,16 +103,34 @@ public class DirectoryListBot extends Bots.BaseBot { } } public void assertMessageTextView(String message) throws UiObjectNotFoundException { UiObject messageTextView = findMessageTextView(); public void assertHeaderMessageText(String message) throws UiObjectNotFoundException { UiObject messageTextView = findHeaderMessageTextView(); assertTrue(messageTextView.exists()); String msg = String.valueOf(message); assertEquals(msg, messageTextView.getText()); } /** * Checks against placeholder text. Placeholder can be Empty page, No results page, or the * "Hourglass" page (ie. something-went-wrong page). */ public void assertPlaceholderMessageText(String message) throws UiObjectNotFoundException { UiObject messageTextView = findPlaceholderMessageTextView(); assertTrue(messageTextView.exists()); String msg = String.valueOf(message); assertEquals(msg, messageTextView.getText()); } private UiObject findHeaderMessageTextView() { return findObject( DIR_CONTAINER_ID, "com.android.documentsui:id/message_textview"); } private UiObject findMessageTextView() { private UiObject findPlaceholderMessageTextView() { return findObject( DIR_CONTAINER_ID, "com.android.documentsui:id/message"); Loading
tests/functional/com/android/documentsui/ArchiveUiTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -40,6 +40,6 @@ public class ArchiveUiTest extends ActivityTest<FilesActivity> { bots.directory.openDocument("broken.zip"); final String msg = String.valueOf(context.getString(R.string.empty)); bots.directory.assertMessageTextView(msg); bots.directory.assertPlaceholderMessageText(msg); } }
tests/functional/com/android/documentsui/FilesActivityDefaultsUiTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -61,7 +61,7 @@ public class FilesActivityDefaultsUiTest extends ActivityTest<FilesActivity> { bots.roots.openRoot(rootDir0.title); String msg = String.valueOf(context.getString(R.string.empty)); bots.directory.assertMessageTextView(msg); bots.directory.assertPlaceholderMessageText(msg); // Check to make sure back button is properly handled by non-Doc type DocHolders device.pressBack(); Loading
tests/functional/com/android/documentsui/FilesActivityUiTest.java +9 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,15 @@ public class FilesActivityUiTest extends ActivityTest<FilesActivity> { bots.main.assertWindowTitle("Images"); } public void testProtectedFolder_showsAuthenticationUi() throws Exception { bots.roots.openRoot("Demo Root"); bots.main.switchToListMode(); bots.directory.openDocument("throw a recoverable exception"); bots.directory.assertHeaderMessageText( "Authentication is required to see the content of this directory"); } public void testFilesListed() throws Exception { bots.directory.assertDocumentsPresent("file0.log", "file1.png", "file2.csv"); } Loading