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

Commit bf81b69e authored by wilsonshih's avatar wilsonshih
Browse files

Fix test case failed at...

Fix test case failed at DocumentsProviderTest#testFindDocumentPath_treeUri_throwsOnNonChildDocument.

For this test, findDocumentPath will throw SecurityException if targetting O or above.

Change-Id: Ib9aa3c22fb653f1d2636778e25d490f7451ff675
Fix:77976091
Test: atest FrameworksCoreTests:DocumentsProviderTest
parent eb582f7c
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -24,7 +24,6 @@ import android.support.test.filters.SmallTest;
import android.test.ProviderTestCase2;
import android.test.ProviderTestCase2;


import java.util.Arrays;
import java.util.Arrays;
import java.util.List;


/**
/**
 * Unit tests for {@link DocumentsProvider}.
 * Unit tests for {@link DocumentsProvider}.
@@ -84,7 +83,10 @@ public class DocumentsProviderTest extends ProviderTestCase2<TestDocumentsProvid


        final Uri docUri = buildTreeDocumentUri(
        final Uri docUri = buildTreeDocumentUri(
                TestDocumentsProvider.AUTHORITY, PARENT_DOCUMENT_ID, DOCUMENT_ID);
                TestDocumentsProvider.AUTHORITY, PARENT_DOCUMENT_ID, DOCUMENT_ID);
        assertNull(DocumentsContract.findDocumentPath(mResolver, docUri));
        try {
            DocumentsContract.findDocumentPath(mResolver, docUri);
            fail("Expected a SecurityException to be throw");
        } catch (SecurityException expected) { }
    }
    }


    public void testFindDocumentPath_treeUri_erasesNonNullRootId() throws Exception {
    public void testFindDocumentPath_treeUri_erasesNonNullRootId() throws Exception {