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

Commit cfb992e4 authored by Khoa Hong's avatar Khoa Hong Committed by Android (Google) Code Review
Browse files

Merge "USB: Add NCM functions to related tests"

parents 85199de9 32492d57
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -117,6 +117,7 @@ public class UsbManagerTestLib {
        testGetCurrentFunctionsMock_Matched(UsbManager.FUNCTION_PTP);
        testGetCurrentFunctionsMock_Matched(UsbManager.FUNCTION_MIDI);
        testGetCurrentFunctionsMock_Matched(UsbManager.FUNCTION_RNDIS);
        testGetCurrentFunctionsMock_Matched(UsbManager.FUNCTION_NCM);
    }

    public void testSetCurrentFunctions_shouldMatched() {
@@ -125,5 +126,6 @@ public class UsbManagerTestLib {
        testSetCurrentFunctionsMock_Matched(UsbManager.FUNCTION_PTP);
        testSetCurrentFunctionsMock_Matched(UsbManager.FUNCTION_MIDI);
        testSetCurrentFunctionsMock_Matched(UsbManager.FUNCTION_RNDIS);
        testSetCurrentFunctionsMock_Matched(UsbManager.FUNCTION_NCM);
    }
}
+8 −0
Original line number Diff line number Diff line
@@ -180,6 +180,14 @@ public class UsbHandlerTest {
        assertNotEquals(mUsbHandler.getEnabledFunctions() & UsbManager.FUNCTION_RNDIS, 0);
    }

    @SmallTest
    @Test
    public void setFunctionsNcm() {
        mUsbHandler.handleMessage(mUsbHandler.obtainMessage(MSG_SET_CURRENT_FUNCTIONS,
                UsbManager.FUNCTION_NCM));
        assertNotEquals(mUsbHandler.getEnabledFunctions() & UsbManager.FUNCTION_NCM, 0);
    }

    @SmallTest
    @Test
    public void setFunctionsNcmAndRndis() {