Loading tests/common/com/android/documentsui/filters/HugeLongTest.java 0 → 100644 +49 −0 Original line number Diff line number Diff line /* * Copyright (C) 2019 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ /* * Copyright (C) 2019 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.documentsui.filters; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Marks a test that should run as part of the Huge and take a long time tests. * * Please mark the test whose duration is larger than 10 seconds. */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD, ElementType.TYPE}) public @interface HugeLongTest { } tests/functional/com/android/documentsui/CancelFromNotificationUiTest.java +5 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import android.util.Log; import androidx.test.filters.LargeTest; import com.android.documentsui.files.FilesActivity; import com.android.documentsui.filters.HugeLongTest; import com.android.documentsui.services.TestNotificationService; import java.util.concurrent.CountDownLatch; Loading Loading @@ -141,6 +142,7 @@ public class CancelFromNotificationUiTest extends ActivityTest<FilesActivity> { } } @HugeLongTest public void testCopyDocument_Cancel() throws Exception { bots.roots.openRoot(ROOT_0_ID); Loading @@ -159,6 +161,7 @@ public class CancelFromNotificationUiTest extends ActivityTest<FilesActivity> { bots.directory.waitForDocument(TARGET_FILE); } @HugeLongTest public void testCopyDocument_CancelFromNotification() throws Exception { bots.roots.openRoot(ROOT_0_ID); bots.directory.findDocument(TARGET_FILE); Loading Loading @@ -191,6 +194,7 @@ public class CancelFromNotificationUiTest extends ActivityTest<FilesActivity> { assertTrue(bots.directory.hasDocuments(TARGET_FILE)); } @HugeLongTest public void testMoveDocument_Cancel() throws Exception { bots.roots.openRoot(ROOT_0_ID); Loading @@ -209,6 +213,7 @@ public class CancelFromNotificationUiTest extends ActivityTest<FilesActivity> { bots.directory.waitForDocument(TARGET_FILE); } @HugeLongTest public void testMoveDocument_CancelFromNotification() throws Exception { bots.roots.openRoot(ROOT_0_ID); bots.directory.findDocument(TARGET_FILE); Loading tests/functional/com/android/documentsui/DirectoryMessagesUiTest.java +6 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.documentsui; import androidx.test.filters.LargeTest; import com.android.documentsui.files.FilesActivity; import com.android.documentsui.filters.HugeLongTest; @LargeTest public class DirectoryMessagesUiTest extends ActivityTest<FilesActivity> { Loading @@ -45,12 +46,14 @@ public class DirectoryMessagesUiTest extends ActivityTest<FilesActivity> { bots.directory.assertHasMessageButtonText("SIGN IN"); } @HugeLongTest public void testInfoMessage_visible() throws Exception { bots.directory.openDocument(DemoProvider.DIR_INFO); bots.directory.assertHasMessage(DemoProvider.MSG_INFO); bots.directory.assertHasMessageButtonText("DISMISS"); } @HugeLongTest public void testInfoMessage_dismissable() throws Exception { bots.directory.openDocument(DemoProvider.DIR_INFO); bots.directory.assertHasMessage(true); Loading @@ -58,12 +61,14 @@ public class DirectoryMessagesUiTest extends ActivityTest<FilesActivity> { bots.directory.assertHasMessage(false); } @HugeLongTest public void testErrorMessage_visible() throws Exception { bots.directory.openDocument(DemoProvider.DIR_ERROR); bots.directory.assertHasMessage(DemoProvider.MSG_ERROR); bots.directory.assertHasMessageButtonText("DISMISS"); } @HugeLongTest public void testErrorMessage_dismissable() throws Exception { bots.directory.openDocument(DemoProvider.DIR_ERROR); bots.directory.assertHasMessage(true); Loading @@ -71,6 +76,7 @@ public class DirectoryMessagesUiTest extends ActivityTest<FilesActivity> { bots.directory.assertHasMessage(false); } @HugeLongTest public void testErrorMessage_supercedesInfoMessage() throws Exception { // When both error and info are returned in Directory, only show the error. bots.directory.openDocument(DemoProvider.DIR_ERROR_AND_INFO); Loading tests/functional/com/android/documentsui/FileCopyUiTest.java +5 −0 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ import com.android.documentsui.base.DocumentInfo; import com.android.documentsui.base.RootInfo; import com.android.documentsui.base.State; import com.android.documentsui.files.FilesActivity; import com.android.documentsui.filters.HugeLongTest; import com.android.documentsui.services.TestNotificationService; import java.util.HashMap; Loading Loading @@ -371,6 +372,7 @@ public class FileCopyUiTest extends ActivityTest<FilesActivity> { } // Copy Internal Storage -> Internal Storage // @HugeLongTest public void testCopyDocuments_InternalStorage() throws Exception { createDocuments(StubProvider.ROOT_0_ID, rootDir0, mDocsHelper); copyFiles(StubProvider.ROOT_0_ID, StubProvider.ROOT_1_ID); Loading @@ -384,6 +386,7 @@ public class FileCopyUiTest extends ActivityTest<FilesActivity> { } // Copy SD Card -> Internal Storage // @HugeLongTest public void testCopyDocuments_FromSdCard() throws Exception { createDocuments(mSdCardLabel, mSdCardRoot, mStorageDocsHelper); copyFiles(mSdCardLabel, Build.MODEL); Loading @@ -397,6 +400,7 @@ public class FileCopyUiTest extends ActivityTest<FilesActivity> { } // Copy Internal Storage -> SD Card // @HugeLongTest public void testCopyDocuments_ToSdCard() throws Exception { createDocuments(Build.MODEL, mPrimaryRoot, mStorageDocsHelper); copyFiles(Build.MODEL, mSdCardLabel); Loading @@ -409,6 +413,7 @@ public class FileCopyUiTest extends ActivityTest<FilesActivity> { assertFilesCopied(mSdCardLabel, mSdCardRoot, mStorageDocsHelper); } @HugeLongTest public void testCopyDocuments_documentsDisabled() throws Exception { mDocsHelper.createDocument(rootDir0, "text/plain", fileName1); bots.roots.openRoot(StubProvider.ROOT_0_ID); Loading tests/functional/com/android/documentsui/FileDeleteUiTest.java +2 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import androidx.test.filters.LargeTest; import com.android.documentsui.base.DocumentInfo; import com.android.documentsui.files.FilesActivity; import com.android.documentsui.filters.HugeLongTest; import com.android.documentsui.services.TestNotificationService; import java.util.ArrayList; Loading Loading @@ -156,6 +157,7 @@ public class FileDeleteUiTest extends ActivityTest<FilesActivity> { exec.shutdown(); } @HugeLongTest public void testDeleteAllDocument() throws Exception { bots.roots.openRoot(ROOT_0_ID); bots.main.clickToolbarOverflowItem( Loading Loading
tests/common/com/android/documentsui/filters/HugeLongTest.java 0 → 100644 +49 −0 Original line number Diff line number Diff line /* * Copyright (C) 2019 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ /* * Copyright (C) 2019 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.documentsui.filters; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Marks a test that should run as part of the Huge and take a long time tests. * * Please mark the test whose duration is larger than 10 seconds. */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD, ElementType.TYPE}) public @interface HugeLongTest { }
tests/functional/com/android/documentsui/CancelFromNotificationUiTest.java +5 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import android.util.Log; import androidx.test.filters.LargeTest; import com.android.documentsui.files.FilesActivity; import com.android.documentsui.filters.HugeLongTest; import com.android.documentsui.services.TestNotificationService; import java.util.concurrent.CountDownLatch; Loading Loading @@ -141,6 +142,7 @@ public class CancelFromNotificationUiTest extends ActivityTest<FilesActivity> { } } @HugeLongTest public void testCopyDocument_Cancel() throws Exception { bots.roots.openRoot(ROOT_0_ID); Loading @@ -159,6 +161,7 @@ public class CancelFromNotificationUiTest extends ActivityTest<FilesActivity> { bots.directory.waitForDocument(TARGET_FILE); } @HugeLongTest public void testCopyDocument_CancelFromNotification() throws Exception { bots.roots.openRoot(ROOT_0_ID); bots.directory.findDocument(TARGET_FILE); Loading Loading @@ -191,6 +194,7 @@ public class CancelFromNotificationUiTest extends ActivityTest<FilesActivity> { assertTrue(bots.directory.hasDocuments(TARGET_FILE)); } @HugeLongTest public void testMoveDocument_Cancel() throws Exception { bots.roots.openRoot(ROOT_0_ID); Loading @@ -209,6 +213,7 @@ public class CancelFromNotificationUiTest extends ActivityTest<FilesActivity> { bots.directory.waitForDocument(TARGET_FILE); } @HugeLongTest public void testMoveDocument_CancelFromNotification() throws Exception { bots.roots.openRoot(ROOT_0_ID); bots.directory.findDocument(TARGET_FILE); Loading
tests/functional/com/android/documentsui/DirectoryMessagesUiTest.java +6 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.documentsui; import androidx.test.filters.LargeTest; import com.android.documentsui.files.FilesActivity; import com.android.documentsui.filters.HugeLongTest; @LargeTest public class DirectoryMessagesUiTest extends ActivityTest<FilesActivity> { Loading @@ -45,12 +46,14 @@ public class DirectoryMessagesUiTest extends ActivityTest<FilesActivity> { bots.directory.assertHasMessageButtonText("SIGN IN"); } @HugeLongTest public void testInfoMessage_visible() throws Exception { bots.directory.openDocument(DemoProvider.DIR_INFO); bots.directory.assertHasMessage(DemoProvider.MSG_INFO); bots.directory.assertHasMessageButtonText("DISMISS"); } @HugeLongTest public void testInfoMessage_dismissable() throws Exception { bots.directory.openDocument(DemoProvider.DIR_INFO); bots.directory.assertHasMessage(true); Loading @@ -58,12 +61,14 @@ public class DirectoryMessagesUiTest extends ActivityTest<FilesActivity> { bots.directory.assertHasMessage(false); } @HugeLongTest public void testErrorMessage_visible() throws Exception { bots.directory.openDocument(DemoProvider.DIR_ERROR); bots.directory.assertHasMessage(DemoProvider.MSG_ERROR); bots.directory.assertHasMessageButtonText("DISMISS"); } @HugeLongTest public void testErrorMessage_dismissable() throws Exception { bots.directory.openDocument(DemoProvider.DIR_ERROR); bots.directory.assertHasMessage(true); Loading @@ -71,6 +76,7 @@ public class DirectoryMessagesUiTest extends ActivityTest<FilesActivity> { bots.directory.assertHasMessage(false); } @HugeLongTest public void testErrorMessage_supercedesInfoMessage() throws Exception { // When both error and info are returned in Directory, only show the error. bots.directory.openDocument(DemoProvider.DIR_ERROR_AND_INFO); Loading
tests/functional/com/android/documentsui/FileCopyUiTest.java +5 −0 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ import com.android.documentsui.base.DocumentInfo; import com.android.documentsui.base.RootInfo; import com.android.documentsui.base.State; import com.android.documentsui.files.FilesActivity; import com.android.documentsui.filters.HugeLongTest; import com.android.documentsui.services.TestNotificationService; import java.util.HashMap; Loading Loading @@ -371,6 +372,7 @@ public class FileCopyUiTest extends ActivityTest<FilesActivity> { } // Copy Internal Storage -> Internal Storage // @HugeLongTest public void testCopyDocuments_InternalStorage() throws Exception { createDocuments(StubProvider.ROOT_0_ID, rootDir0, mDocsHelper); copyFiles(StubProvider.ROOT_0_ID, StubProvider.ROOT_1_ID); Loading @@ -384,6 +386,7 @@ public class FileCopyUiTest extends ActivityTest<FilesActivity> { } // Copy SD Card -> Internal Storage // @HugeLongTest public void testCopyDocuments_FromSdCard() throws Exception { createDocuments(mSdCardLabel, mSdCardRoot, mStorageDocsHelper); copyFiles(mSdCardLabel, Build.MODEL); Loading @@ -397,6 +400,7 @@ public class FileCopyUiTest extends ActivityTest<FilesActivity> { } // Copy Internal Storage -> SD Card // @HugeLongTest public void testCopyDocuments_ToSdCard() throws Exception { createDocuments(Build.MODEL, mPrimaryRoot, mStorageDocsHelper); copyFiles(Build.MODEL, mSdCardLabel); Loading @@ -409,6 +413,7 @@ public class FileCopyUiTest extends ActivityTest<FilesActivity> { assertFilesCopied(mSdCardLabel, mSdCardRoot, mStorageDocsHelper); } @HugeLongTest public void testCopyDocuments_documentsDisabled() throws Exception { mDocsHelper.createDocument(rootDir0, "text/plain", fileName1); bots.roots.openRoot(StubProvider.ROOT_0_ID); Loading
tests/functional/com/android/documentsui/FileDeleteUiTest.java +2 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import androidx.test.filters.LargeTest; import com.android.documentsui.base.DocumentInfo; import com.android.documentsui.files.FilesActivity; import com.android.documentsui.filters.HugeLongTest; import com.android.documentsui.services.TestNotificationService; import java.util.ArrayList; Loading Loading @@ -156,6 +157,7 @@ public class FileDeleteUiTest extends ActivityTest<FilesActivity> { exec.shutdown(); } @HugeLongTest public void testDeleteAllDocument() throws Exception { bots.roots.openRoot(ROOT_0_ID); bots.main.clickToolbarOverflowItem( Loading