Loading tests/common/com/android/documentsui/bots/Bots.java +1 −1 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ import androidx.test.InstrumentationRegistry; */ public final class Bots { private static final int TIMEOUT = 5000; private static final int TIMEOUT = 15000; public final BreadBot breadcrumb; public final DirectoryListBot directory; Loading tests/functional/com/android/documentsui/ActionCreateDocumentUiTest.java +4 −2 Original line number Diff line number Diff line Loading @@ -57,15 +57,16 @@ public class ActionCreateDocumentUiTest { private Context mTargetContext; private Context mContext; private Bots mBots; private UiDevice mDevice; @Before public void setup() { UiDevice device = UiDevice.getInstance(getInstrumentation()); UiAutomation automation = getInstrumentation().getUiAutomation(); mDevice = UiDevice.getInstance(getInstrumentation()); mTargetContext = getInstrumentation().getTargetContext(); mContext = getInstrumentation().getContext(); mBots = new Bots(device, automation, mTargetContext, 5000); mBots = new Bots(mDevice, automation, mTargetContext, 5000); } @Test Loading @@ -84,6 +85,7 @@ public class ActionCreateDocumentUiTest { mBots.main.setDialogText(fileName); mBots.main.clickSaveButton(); mDevice.waitForIdle(); Instrumentation.ActivityResult activityResult = mRule.getActivityResult(); Loading tests/functional/com/android/documentsui/CancelFromNotificationUiTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -51,7 +51,7 @@ public class CancelFromNotificationUiTest extends ActivityTest<FilesActivity> { private static final int BUFFER_SIZE = 10 * 1024 * 1024; private static final int WAIT_TIME_SECONDS = 60; private static final int WAIT_TIME_SECONDS = 120; private final BroadcastReceiver mReceiver = new BroadcastReceiver() { @Override Loading tests/functional/com/android/documentsui/ContextMenuUiTest.java +0 −1 Original line number Diff line number Diff line Loading @@ -52,7 +52,6 @@ public class ContextMenuUiTest extends ActivityTest<FilesActivity> { menuItems.put("Rename", false); menuItems.put("Delete", false); menuItems.put("Open in new window", false); menuItems.put("Paste into folder", false); menuItems.put("Select all", false); menuItems.put("New folder", false); } Loading tests/functional/com/android/documentsui/FileCopyUiTest.java +33 −3 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ import android.os.Bundle; import android.os.RemoteException; import android.os.SystemClock; import android.provider.Settings; import android.support.test.uiautomator.UiObjectNotFoundException; import android.text.TextUtils; import android.util.Log; Loading Loading @@ -153,8 +154,13 @@ public class FileCopyUiTest extends ActivityTest<FilesActivity> { mIsVirtualSdCard = enableVirtualSdCard(); assertTrue("Cannot set virtual SD Card", mIsVirtualSdCard); // Call initStorageRootInfo() again for setting SD Card root int attempts = 0; while (mSdCardRoot == null && attempts++ < 15) { SystemClock.sleep(1000); initStorageRootInfo(); } assertNotNull("Cannot find virtual SD Card", mSdCardRoot); } IntentFilter filter = new IntentFilter(); filter.addAction(TestNotificationService.ACTION_OPERATION_RESULT); Loading @@ -167,14 +173,38 @@ public class FileCopyUiTest extends ActivityTest<FilesActivity> { public void tearDown() throws Exception { // Delete created files deleteDocuments(mDeviceLabel); try { deleteDocuments(mSdCardLabel); } catch (UiObjectNotFoundException e) { Log.d(TAG, "SD Card ejected unexpectedly. ", e); mSdCardRoot = null; mSdCardLabel = null; } for (RootAndFolderPair rootAndFolder : mFoldersToCleanup) { deleteDocuments(rootAndFolder.root, rootAndFolder.folder); } if (mIsVirtualSdCard) { // Eject virtual SD card if (mIsVirtualSdCard && mSdCardRoot != null) { device.executeShellCommand("sm set-virtual-disk false"); int attempts = 0; while (mSdCardRoot != null && attempts++ < 15) { List<RootInfo> rootList = mStorageDocsHelper.getRootList(); boolean sdCardRootHidden = true; for (RootInfo info : rootList) { if (info.isSd()) { sdCardRootHidden = false; SystemClock.sleep(1000); break; } } if (sdCardRootHidden) { mSdCardRoot = null; mSdCardLabel = null; } } assertNull("Cannot eject virtual SD Card", mSdCardRoot); } device.executeShellCommand("settings put global stay_on_while_plugged_in " Loading Loading
tests/common/com/android/documentsui/bots/Bots.java +1 −1 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ import androidx.test.InstrumentationRegistry; */ public final class Bots { private static final int TIMEOUT = 5000; private static final int TIMEOUT = 15000; public final BreadBot breadcrumb; public final DirectoryListBot directory; Loading
tests/functional/com/android/documentsui/ActionCreateDocumentUiTest.java +4 −2 Original line number Diff line number Diff line Loading @@ -57,15 +57,16 @@ public class ActionCreateDocumentUiTest { private Context mTargetContext; private Context mContext; private Bots mBots; private UiDevice mDevice; @Before public void setup() { UiDevice device = UiDevice.getInstance(getInstrumentation()); UiAutomation automation = getInstrumentation().getUiAutomation(); mDevice = UiDevice.getInstance(getInstrumentation()); mTargetContext = getInstrumentation().getTargetContext(); mContext = getInstrumentation().getContext(); mBots = new Bots(device, automation, mTargetContext, 5000); mBots = new Bots(mDevice, automation, mTargetContext, 5000); } @Test Loading @@ -84,6 +85,7 @@ public class ActionCreateDocumentUiTest { mBots.main.setDialogText(fileName); mBots.main.clickSaveButton(); mDevice.waitForIdle(); Instrumentation.ActivityResult activityResult = mRule.getActivityResult(); Loading
tests/functional/com/android/documentsui/CancelFromNotificationUiTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -51,7 +51,7 @@ public class CancelFromNotificationUiTest extends ActivityTest<FilesActivity> { private static final int BUFFER_SIZE = 10 * 1024 * 1024; private static final int WAIT_TIME_SECONDS = 60; private static final int WAIT_TIME_SECONDS = 120; private final BroadcastReceiver mReceiver = new BroadcastReceiver() { @Override Loading
tests/functional/com/android/documentsui/ContextMenuUiTest.java +0 −1 Original line number Diff line number Diff line Loading @@ -52,7 +52,6 @@ public class ContextMenuUiTest extends ActivityTest<FilesActivity> { menuItems.put("Rename", false); menuItems.put("Delete", false); menuItems.put("Open in new window", false); menuItems.put("Paste into folder", false); menuItems.put("Select all", false); menuItems.put("New folder", false); } Loading
tests/functional/com/android/documentsui/FileCopyUiTest.java +33 −3 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ import android.os.Bundle; import android.os.RemoteException; import android.os.SystemClock; import android.provider.Settings; import android.support.test.uiautomator.UiObjectNotFoundException; import android.text.TextUtils; import android.util.Log; Loading Loading @@ -153,8 +154,13 @@ public class FileCopyUiTest extends ActivityTest<FilesActivity> { mIsVirtualSdCard = enableVirtualSdCard(); assertTrue("Cannot set virtual SD Card", mIsVirtualSdCard); // Call initStorageRootInfo() again for setting SD Card root int attempts = 0; while (mSdCardRoot == null && attempts++ < 15) { SystemClock.sleep(1000); initStorageRootInfo(); } assertNotNull("Cannot find virtual SD Card", mSdCardRoot); } IntentFilter filter = new IntentFilter(); filter.addAction(TestNotificationService.ACTION_OPERATION_RESULT); Loading @@ -167,14 +173,38 @@ public class FileCopyUiTest extends ActivityTest<FilesActivity> { public void tearDown() throws Exception { // Delete created files deleteDocuments(mDeviceLabel); try { deleteDocuments(mSdCardLabel); } catch (UiObjectNotFoundException e) { Log.d(TAG, "SD Card ejected unexpectedly. ", e); mSdCardRoot = null; mSdCardLabel = null; } for (RootAndFolderPair rootAndFolder : mFoldersToCleanup) { deleteDocuments(rootAndFolder.root, rootAndFolder.folder); } if (mIsVirtualSdCard) { // Eject virtual SD card if (mIsVirtualSdCard && mSdCardRoot != null) { device.executeShellCommand("sm set-virtual-disk false"); int attempts = 0; while (mSdCardRoot != null && attempts++ < 15) { List<RootInfo> rootList = mStorageDocsHelper.getRootList(); boolean sdCardRootHidden = true; for (RootInfo info : rootList) { if (info.isSd()) { sdCardRootHidden = false; SystemClock.sleep(1000); break; } } if (sdCardRootHidden) { mSdCardRoot = null; mSdCardLabel = null; } } assertNull("Cannot eject virtual SD Card", mSdCardRoot); } device.executeShellCommand("settings put global stay_on_while_plugged_in " Loading