Merge "Don't run testRequestLatestEntitlementResult if not supported"

This commit is contained in:
Mark Chien
2020-07-10 07:06:56 +00:00
committed by Gerrit Code Review

View File

@@ -697,6 +697,7 @@ public class TetheringManagerTest {
@Test @Test
public void testRequestLatestEntitlementResult() throws Exception { public void testRequestLatestEntitlementResult() throws Exception {
assumeTrue(mTM.isTetheringSupported());
// Verify that requestLatestTetheringEntitlementResult() can get entitlement // Verify that requestLatestTetheringEntitlementResult() can get entitlement
// result(TETHER_ERROR_ENTITLEMENT_UNKNOWN due to invalid downstream type) via listener. // result(TETHER_ERROR_ENTITLEMENT_UNKNOWN due to invalid downstream type) via listener.
assertEntitlementResult(listener -> mTM.requestLatestTetheringEntitlementResult( assertEntitlementResult(listener -> mTM.requestLatestTetheringEntitlementResult(
@@ -715,6 +716,9 @@ public class TetheringManagerTest {
}, false), }, false),
TETHER_ERROR_ENTITLEMENT_UNKNOWN); TETHER_ERROR_ENTITLEMENT_UNKNOWN);
// Do not request TETHERING_WIFI entitlement result if TETHERING_WIFI is not available.
assumeTrue(mTM.getTetherableWifiRegexs().length > 0);
// Verify that null listener will cause IllegalArgumentException. // Verify that null listener will cause IllegalArgumentException.
try { try {
mTM.requestLatestTetheringEntitlementResult( mTM.requestLatestTetheringEntitlementResult(