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

Commit da294fe5 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 6520394 from d11b7e9b to rvc-release

Change-Id: I54bdb033f76a5e9f40eecef65ba22f193d30009a
parents a8c6c903 d11b7e9b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
+4 −2
Original line number Diff line number Diff line
@@ -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
@@ -84,6 +85,7 @@ public class ActionCreateDocumentUiTest {

        mBots.main.setDialogText(fileName);
        mBots.main.clickSaveButton();
        mDevice.waitForIdle();

        Instrumentation.ActivityResult activityResult = mRule.getActivityResult();

+1 −1
Original line number Diff line number Diff line
@@ -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
+0 −1
Original line number Diff line number Diff line
@@ -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);
    }
+33 −3
Original line number Diff line number Diff line
@@ -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;

@@ -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);
@@ -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 "