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

Commit a4a406e9 authored by Ben Reich's avatar Ben Reich
Browse files

Add tests for viewInOwner and openSettings

The test coverage for these methods is non-existant, let's increase
the coverage for these methods.

Bug: 395926758
Test: atest com.android.documentsui.files.ActionHandlerTest
Flag: EXEMPT test changes
Change-Id: Ic9093428d50b0e182d5cae3f051df4b670d2d96f
parent ddabc5d7
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -810,6 +810,23 @@ public class ActionHandlerTest {
        assertFalse(intent.getExtras().containsKey(Intent.EXTRA_TITLE));
    }

    @Test
    public void testViewInOwner() {
        mEnv.populateStack();

        mEnv.selectionMgr.clearSelection();
        mEnv.selectDocument(TestEnv.FILE_PNG);

        mHandler.viewInOwner();
        mActivity.assertActivityStarted(DocumentsContract.ACTION_DOCUMENT_SETTINGS);
    }

    @Test
    public void testOpenSettings() {
        mHandler.openSettings(TestProvidersAccess.HAMMY);
        mActivity.assertActivityStarted(DocumentsContract.ACTION_DOCUMENT_ROOT_SETTINGS);
    }

    private void assertRootPicked(Uri expectedUri) throws Exception {
        mEnv.beforeAsserts();