Skip to content
Snippets Groups Projects
Commit 0baeb908 authored by Ying Xu's avatar Ying Xu
Browse files

Add the CTS tests for new public APIs in NetworkRequest

Bug: 315835605
Test: atest android.net.cts.NetworkRequestTest
Change-Id: Ie4ed844d59a20bfd1a222fb6a85ad14c08f2efbd
parent 54aaccc1
No related branches found
No related tags found
No related merge requests found
......@@ -32,6 +32,8 @@ import static android.net.NetworkCapabilities.TRANSPORT_WIFI;
import static com.android.testutils.DevSdkIgnoreRuleKt.VANILLA_ICE_CREAM;
import static com.google.common.truth.Truth.assertThat;
import static junit.framework.Assert.fail;
import static org.junit.Assert.assertArrayEquals;
......@@ -172,6 +174,20 @@ public class NetworkRequestTest {
.getNetworkSpecifier());
}
@Test
@IgnoreUpTo(Build.VERSION_CODES.S)
public void testSubscriptionIds() {
int[] subIds = {1, 2};
assertTrue(
new NetworkRequest.Builder().build()
.getSubscriptionIds().isEmpty());
assertThat(new NetworkRequest.Builder()
.setSubscriptionIds(Set.of(subIds[0], subIds[1]))
.build()
.getSubscriptionIds())
.containsExactly(subIds[0], subIds[1]);
}
@Test
@IgnoreUpTo(Build.VERSION_CODES.Q)
public void testRequestorPackageName() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment