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

Commit b9ecf91d authored by François Degros's avatar François Degros
Browse files

Fix test case in ActionHandlerTest

The expected outcome depends on the value of the use_material3 and the
zip_ng_ro flags.

Bug: 406857992
Bug: 402289261
Flag: com.android.documentsui.flags.use_material3
Flag: com.android.documentsui.flags.zip_ng_ro
Test: atest DocumentsUIGoogleTests:com.android.documentsui.files.ActionHandlerTest
Change-Id: I115d2ab766629c3973509f77b1ed99c1a039bcc1
parent 3c43eff8
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

package com.android.documentsui.files;

import static com.android.documentsui.util.FlagUtils.isUseMaterial3FlagEnabled;
import static com.android.documentsui.testing.IntentAsserts.assertHasAction;
import static com.android.documentsui.testing.IntentAsserts.assertHasData;
import static com.android.documentsui.testing.IntentAsserts.assertHasExtra;
@@ -24,6 +23,8 @@ import static com.android.documentsui.testing.IntentAsserts.assertHasExtraIntent
import static com.android.documentsui.testing.IntentAsserts.assertHasExtraList;
import static com.android.documentsui.testing.IntentAsserts.assertHasExtraUri;
import static com.android.documentsui.testing.IntentAsserts.assertTargetsComponent;
import static com.android.documentsui.util.FlagUtils.isUseMaterial3FlagEnabled;
import static com.android.documentsui.util.FlagUtils.isZipNgFlagEnabled;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
@@ -400,13 +401,17 @@ public class ActionHandlerTest {
    }

    @Test
    public void testDocumentPicked_InArchive_Unopenable() throws Exception {
    public void testDocumentPicked_InArchive_OpenableOrNot() throws Exception {
        mActivity.currentRoot = TestProvidersAccess.HOME;

        mHandler.openDocument(TestEnv.FILE_IN_ARCHIVE, ActionHandler.VIEW_TYPE_PREVIEW,
                ActionHandler.VIEW_TYPE_REGULAR);
        if (isZipNgFlagEnabled()) {
            mActivity.assertActivityStarted(Intent.ACTION_VIEW);
        } else {
            mDialogs.assertViewInArchivesShownUnsupported();
        }
    }

    @Test
    public void testDocumentPicked_PreviewsWhenResourceSet() throws Exception {