From 2a1f61829e850a33c541ff683a3ab2a321bdba0f Mon Sep 17 00:00:00 2001 From: Yu-Han Yang Date: Thu, 18 Mar 2021 10:17:48 -0700 Subject: [PATCH] Remove tests for Location Services summary Bug: 183068632 Test: make -j64 RunSettingsRoboTests ROBOTEST_FILTER="com.android.settings.location.LocationServicesPreferenceControllerTest" Change-Id: I9c310ba1c320c182030e5ba7c64099e1b65ea109 --- ...ationServicesPreferenceControllerTest.java | 43 ------------------- 1 file changed, 43 deletions(-) diff --git a/tests/robotests/src/com/android/settings/location/LocationServicesPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/location/LocationServicesPreferenceControllerTest.java index d7d76bef7c7..f5868c2f8ec 100644 --- a/tests/robotests/src/com/android/settings/location/LocationServicesPreferenceControllerTest.java +++ b/tests/robotests/src/com/android/settings/location/LocationServicesPreferenceControllerTest.java @@ -19,13 +19,8 @@ package com.android.settings.location; import static com.google.common.truth.Truth.assertThat; import static org.mockito.Mockito.spy; -import static org.mockito.Mockito.when; import android.content.Context; -import android.net.wifi.WifiManager; -import android.provider.Settings; - -import com.android.settings.R; import org.junit.Before; import org.junit.Test; @@ -39,7 +34,6 @@ import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) public class LocationServicesPreferenceControllerTest { @Mock - private WifiManager mWifiManager; private Context mContext; private LocationServicesPreferenceController mController; @@ -47,7 +41,6 @@ public class LocationServicesPreferenceControllerTest { public void setUp() { MockitoAnnotations.initMocks(this); mContext = spy(RuntimeEnvironment.application); - when(mContext.getSystemService(WifiManager.class)).thenReturn(mWifiManager); mController = new LocationServicesPreferenceController(mContext, "key"); } @@ -56,42 +49,6 @@ public class LocationServicesPreferenceControllerTest { assertThat(mController.isAvailable()).isTrue(); } - @Test - public void testLocationScanning_WifiOnBleOn() { - when(mWifiManager.isScanAlwaysAvailable()).thenReturn(true); - Settings.Global.putInt(mContext.getContentResolver(), - Settings.Global.BLE_SCAN_ALWAYS_AVAILABLE, 1); - assertThat(mController.getSummary()).isEqualTo( - mContext.getString(R.string.scanning_status_text_wifi_on_ble_on)); - } - - @Test - public void testLocationScanning_WifiOnBleOff() { - when(mWifiManager.isScanAlwaysAvailable()).thenReturn(true); - Settings.Global.putInt(mContext.getContentResolver(), - Settings.Global.BLE_SCAN_ALWAYS_AVAILABLE, 0); - assertThat(mController.getSummary()).isEqualTo( - mContext.getString(R.string.scanning_status_text_wifi_on_ble_off)); - } - - @Test - public void testLocationScanning_WifiOffBleOn() { - when(mWifiManager.isScanAlwaysAvailable()).thenReturn(false); - Settings.Global.putInt(mContext.getContentResolver(), - Settings.Global.BLE_SCAN_ALWAYS_AVAILABLE, 1); - assertThat(mController.getSummary()).isEqualTo( - mContext.getString(R.string.scanning_status_text_wifi_off_ble_on)); - } - - @Test - public void testLocationScanning_WifiOffBleOff() { - when(mWifiManager.isScanAlwaysAvailable()).thenReturn(false); - Settings.Global.putInt(mContext.getContentResolver(), - Settings.Global.BLE_SCAN_ALWAYS_AVAILABLE, 0); - assertThat(mController.getSummary()).isEqualTo( - mContext.getString(R.string.scanning_status_text_wifi_off_ble_off)); - } - @Test @Config(qualifiers = "mcc999") public void testLocationScanning_ifDisabled_shouldNotBeShown() {