Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 542f76a5 authored by Yi-Ling Chuang's avatar Yi-Ling Chuang
Browse files

Fix TetherSettingsTest

Fixes: 151204777
Test: run TetherSettingsTest
Change-Id: Ic510aac7fc7f9af095e78473bc191a4e903dcaba
parent b8fb854e
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -30,9 +30,12 @@ import android.net.ConnectivityManager;
import android.net.wifi.WifiManager;
import android.os.UserHandle;
import android.os.UserManager;
import android.util.FeatureFlagUtils;

import androidx.preference.Preference;

import com.android.settings.core.FeatureFlags;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -72,6 +75,7 @@ public class TetherSettingsTest {

    @Test
    public void testTetherNonIndexableKeys_tetherAvailable_keysNotReturned() {
        FeatureFlagUtils.setEnabled(mContext, FeatureFlags.TETHER_ALL_IN_ONE, false);
        // To let TetherUtil.isTetherAvailable return true, select one of the combinations
        setupIsTetherAvailable(true);

@@ -106,6 +110,7 @@ public class TetherSettingsTest {

    @Test
    public void testTetherNonIndexableKeys_usbAvailable_usbKeyNotReturned() {
        FeatureFlagUtils.setEnabled(mContext, FeatureFlags.TETHER_ALL_IN_ONE, false);
        // We can ignore the condition of Utils.isMonkeyRunning()
        // In normal case, monkey and robotest should not execute at the same time
        when(mConnectivityManager.getTetherableUsbRegexs()).thenReturn(new String[]{"dummyRegex"});
@@ -128,6 +133,7 @@ public class TetherSettingsTest {

    @Test
    public void testTetherNonIndexableKeys_bluetoothAvailable_bluetoothKeyNotReturned() {
        FeatureFlagUtils.setEnabled(mContext, FeatureFlags.TETHER_ALL_IN_ONE, false);
        when(mConnectivityManager.getTetherableBluetoothRegexs())
                .thenReturn(new String[]{"dummyRegex"});