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

Commit f558f8f3 authored by Corina Grigoras's avatar Corina Grigoras
Browse files

Run tests broken on R- only on S+.

These tests were broken by ag/16425947 - the CL adds a call to shouldRestrictStorageAccessFramework, which uses PackageManager#getApplicationInfo, which is executed during the 2 tests ignored. However, the tests are unit tests and use a mock PackageManager, so we hit NPE.

Bug: 211350638
Change-Id: I48e2acfa5dd228984c591196ffc452d113887e47
Test: Presubmit
parent 06ca4fa4
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ import android.provider.DocumentsContract.Path;

import androidx.fragment.app.FragmentActivity;
import androidx.test.filters.MediumTest;
import androidx.test.filters.SdkSuppress;
import androidx.test.runner.AndroidJUnit4;

import com.android.documentsui.DocumentsAccess;
@@ -168,6 +169,9 @@ public class ActionHandlerTest {
    }

    @Test
    // TODO(b/236963677) Test is broken pre-S by ag/16425947. The change introduces usage
    // of PackageManager, which is mocked by the test and results in NPE.
    @SdkSuppress(minSdkVersion = 31, codeName = "S")
    public void testInitLocation_LaunchToDocuments() throws Exception {
        if (!mEnv.features.isLaunchToDocumentEnabled()) {
            return;
@@ -234,6 +238,9 @@ public class ActionHandlerTest {
    }

    @Test
    // TODO(b/236963677) Test is broken pre-S by ag/16425947. The change introduces usage
    // of PackageManager, which is mocked by the test and results in NPE.
    @SdkSuppress(minSdkVersion = 31, codeName = "S")
    public void testInitLocation_DefaultToDeviceRoot_ActionOpenTree_RootDoesNotSupportChildren()
            throws Exception {
        mEnv.state.action = State.ACTION_OPEN_TREE;