Merge "Add XML attribute to toggle on/off LocationModePreferenceController."
This commit is contained in:
committed by
Android (Google) Code Review
commit
ac301bb5e5
@@ -15,6 +15,8 @@
|
||||
*/
|
||||
package com.android.settings.location;
|
||||
|
||||
import static junit.framework.Assert.assertFalse;
|
||||
import static junit.framework.Assert.assertTrue;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.ArgumentMatchers.anyInt;
|
||||
import static org.mockito.ArgumentMatchers.eq;
|
||||
@@ -72,6 +74,17 @@ public class LocationModePreferenceControllerTest {
|
||||
when(mScreen.findPreference(mController.getPreferenceKey())).thenReturn(mPreference);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Config(qualifiers = "mcc999")
|
||||
public void locationModePreference_ifXmlSetToFalse_shouldNotBeAvailable() {
|
||||
assertFalse(mController.isAvailable());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void locationModePreference_ifXmlSetToTrue_shouldBeAvailable() {
|
||||
assertTrue(mController.isAvailable());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void onLocationModeChanged_locationOff_shouldDisablePreference() {
|
||||
when(mUserManager.hasUserRestriction(any())).thenReturn(false);
|
||||
|
Reference in New Issue
Block a user