Merge "Add CTS test for API setLegacyExtraInfo"

This commit is contained in:
Frank Li
2021-06-08 11:15:06 +00:00
committed by Gerrit Code Review

View File

@@ -59,6 +59,7 @@ class NetworkAgentConfigTest {
@Test @IgnoreUpTo(Build.VERSION_CODES.Q)
fun testBuilder() {
val testExtraInfo = "mylegacyExtraInfo"
val config = NetworkAgentConfig.Builder().apply {
setExplicitlySelected(true)
setLegacyType(ConnectivityManager.TYPE_ETHERNET)
@@ -67,6 +68,7 @@ class NetworkAgentConfigTest {
setUnvalidatedConnectivityAcceptable(true)
setLegacyTypeName("TEST_NETWORK")
if (isAtLeastS()) {
setLegacyExtraInfo(testExtraInfo)
setNat64DetectionEnabled(false)
setProvisioningNotificationEnabled(false)
setBypassableVpn(true)
@@ -80,6 +82,7 @@ class NetworkAgentConfigTest {
assertTrue(config.isUnvalidatedConnectivityAcceptable())
assertEquals("TEST_NETWORK", config.getLegacyTypeName())
if (isAtLeastS()) {
assertEquals(testExtraInfo, config.getLegacyExtraInfo())
assertFalse(config.isNat64DetectionEnabled())
assertFalse(config.isProvisioningNotificationEnabled())
assertTrue(config.isBypassableVpn())