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

Commit 45e2bcb8 authored by FanWu's avatar FanWu Committed by Fan Wu
Browse files

Fix ModuleLicensePreferenceTest. The intent may contain multiple flags, so...

Fix ModuleLicensePreferenceTest. The intent may contain multiple flags, so just checking whether the needed one is included

Fix: 215072120

Test: atest
Change-Id: I71707a6e8dc0e728e3c20d2c626c204c63064dae
parent a909150e
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -24,7 +24,6 @@ import android.content.Intent;
import android.content.pm.ModuleInfo;

import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.MockitoAnnotations;
@@ -57,7 +56,6 @@ public class ModuleLicensePreferenceTest {
    }

    @Test
    @Ignore
    public void onClick_sendsCorrectIntent() {
        ModuleLicensePreference pref = new ModuleLicensePreference(mContext, mModuleInfo);

@@ -69,7 +67,7 @@ public class ModuleLicensePreferenceTest {
                .isEqualTo(ModuleLicenseProvider.getUriForPackage(PACKAGE_NAME));
        assertThat(intent.getType()).isEqualTo(ModuleLicenseProvider.LICENSE_FILE_MIME_TYPE);
        assertThat(intent.getCharSequenceExtra(Intent.EXTRA_TITLE)).isEqualTo(NAME);
        assertThat(intent.getFlags()).isEqualTo(Intent.FLAG_GRANT_READ_URI_PERMISSION);
        assertThat((intent.getFlags() & Intent.FLAG_GRANT_READ_URI_PERMISSION)).isNotEqualTo(0);
        assertThat(intent.getCategories()).contains(Intent.CATEGORY_DEFAULT);
        assertThat(intent.getPackage()).isEqualTo("com.android.htmlviewer");
    }