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
commit 1129c316fd

View file

@ -697,6 +697,7 @@ public class TetheringManagerTest {
@Test
public void testRequestLatestEntitlementResult() throws Exception {
assumeTrue(mTM.isTetheringSupported());
// Verify that requestLatestTetheringEntitlementResult() can get entitlement
// result(TETHER_ERROR_ENTITLEMENT_UNKNOWN due to invalid downstream type) via listener.
assertEntitlementResult(listener -> mTM.requestLatestTetheringEntitlementResult(
@ -715,6 +716,9 @@ public class TetheringManagerTest {
}, false),
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.
try {
mTM.requestLatestTetheringEntitlementResult(