Mark most VpnServiceTest methods as @AppModeFull. am: 60b26ee453

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1648190

Change-Id: I6fcb53be747a5e95d58f2d84b16214cf9607a3d0
This commit is contained in:
Lorenzo Colitti
2021-03-22 15:29:05 +00:00
committed by Automerger Merge Worker

View File

@@ -47,6 +47,7 @@ public class VpnServiceTest extends AndroidTestCase {
assertEquals(1, count);
}
@AppModeFull(reason = "establish() requires prepare(), which requires PackageManager access")
public void testEstablish() throws Exception {
ParcelFileDescriptor descriptor = null;
try {
@@ -62,7 +63,7 @@ public class VpnServiceTest extends AndroidTestCase {
}
}
@AppModeFull(reason = "Socket cannot bind in instant app mode")
@AppModeFull(reason = "Protecting sockets requires prepare(), which requires PackageManager")
public void testProtect_DatagramSocket() throws Exception {
DatagramSocket socket = new DatagramSocket();
try {
@@ -77,6 +78,7 @@ public class VpnServiceTest extends AndroidTestCase {
}
}
@AppModeFull(reason = "Protecting sockets requires prepare(), which requires PackageManager")
public void testProtect_Socket() throws Exception {
Socket socket = new Socket();
try {
@@ -91,7 +93,7 @@ public class VpnServiceTest extends AndroidTestCase {
}
}
@AppModeFull(reason = "Socket cannot bind in instant app mode")
@AppModeFull(reason = "Protecting sockets requires prepare(), which requires PackageManager")
public void testProtect_int() throws Exception {
DatagramSocket socket = new DatagramSocket();
ParcelFileDescriptor descriptor = ParcelFileDescriptor.fromDatagramSocket(socket);