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

Commit 30f0fc7f authored by Tomasz Mikolajewski's avatar Tomasz Mikolajewski Committed by Android (Google) Code Review
Browse files

Merge "Fix flaky testLoadsHomebyDefault."

parents c67aacc7 1c0b2326
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -53,6 +53,7 @@ public class FilesActivityUiTest extends InstrumentationTestCase {
    private ContentProviderClient mClient;
    private RootInfo mRoot_0;
    private RootInfo mRoot_1;
    private FilesActivity mActivity;

    public void setUp() throws Exception {
        // Initialize UiDevice instance.
@@ -76,7 +77,8 @@ public class FilesActivityUiTest extends InstrumentationTestCase {
        // Launch app.
        Intent intent = mContext.getPackageManager().getLaunchIntentForPackage(TARGET_PKG);
        intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
        mContext.startActivity(intent);
        mActivity = launchActivityWithIntent(TARGET_PKG, FilesActivity.class, intent);
        assertNotNull("Activity not started.", mActivity);

        // Wait for the app to appear.
        mDevice.wait(Until.hasObject(By.pkg(TARGET_PKG).depth(0)), TIMEOUT);
@@ -90,6 +92,12 @@ public class FilesActivityUiTest extends InstrumentationTestCase {
    @Override
    protected void tearDown() throws Exception {
        super.tearDown();

        if (mActivity != null) {
            mActivity.finish();
            mActivity = null;
        }

        Log.d(TAG, "Resetting storage from setUp");
        resetStorage();
        mClient.release();