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

Commit 11dbe145 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix TetherSettingsTest" into rvc-dev

parents 16a7ba81 542f76a5
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"});