| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package com.android.server.usbtest; |
| 18 |
|
| 19 |
import android.content.Context; |
| 20 |
import android.hardware.usb.UsbManager; |
| 21 |
|
| 22 |
import androidx.test.InstrumentationRegistry; |
| 23 |
import androidx.test.filters.SmallTest; |
| 24 |
import androidx.test.runner.AndroidJUnit4; |
| 25 |
|
| 26 |
import org.junit.Ignore; |
| 27 |
import org.junit.Test; |
| 28 |
import org.junit.runner.RunWith; |
| 29 |
|
| 30 |
import com.android.server.usblib.UsbManagerTestLib; |
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
@SmallTest |
| 37 |
@RunWith(AndroidJUnit4.class) |
| 38 |
public class UsbManagerApiTest { |
| 39 |
private Context mContext; |
| 40 |
|
| 41 |
private final UsbManagerTestLib mUsbManagerTestLib = |
| 42 |
new UsbManagerTestLib(mContext = InstrumentationRegistry.getContext()); |
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
@Test |
| 49 |
public void testUsbApi_GetCurrentFunctionsSys_shouldNoSecurityException() throws Exception { |
| 50 |
mUsbManagerTestLib.testGetCurrentFunctionsSysEx(); |
| 51 |
} |
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
@Test |
| 58 |
public void testUsbApi_SetCurrentFunctionsSys_shouldNoSecurityException() throws Exception { |
| 59 |
mUsbManagerTestLib.testSetCurrentFunctionsSysEx(UsbManager.FUNCTION_NONE); |
| 60 |
} |
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
@Test |
| 67 |
public void testUsbApi_GetCurrentFunctions_shouldNoSecurityException() throws Exception { |
| 68 |
mUsbManagerTestLib.testGetCurrentFunctionsEx(); |
| 69 |
} |
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
@Test |
| 76 |
public void testUsbApi_SetCurrentFunctions_shouldNoSecurityException() throws Exception { |
| 77 |
mUsbManagerTestLib.testSetCurrentFunctionsEx(UsbManager.FUNCTION_NONE); |
| 78 |
} |
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
@Test |
| 84 |
public void testUsbApi_GetCurrentFunctions_shouldMatched() { |
| 85 |
mUsbManagerTestLib.testGetCurrentFunctions_shouldMatched(); |
| 86 |
} |
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
@Test |
| 92 |
public void testUsbApi_SetCurrentFunctions_shouldMatched() { |
| 93 |
mUsbManagerTestLib.testSetCurrentFunctions_shouldMatched(); |
| 94 |
} |
| 95 |
} |