Merge "Add the CTS tests for new public APIs in NetworkRequest" into main
This commit is contained in:
commit
796ea8b751
1 changed files with 16 additions and 0 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue