Skip to content
Snippets Groups Projects
Commit 796ea8b7 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Add the CTS tests for new public APIs in NetworkRequest" into main

parents b19fd541 0baeb908
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