Merge "Add remaining whitelisted controllers"

This commit is contained in:
TreeHugger Robot
2018-05-25 16:47:57 +00:00
committed by Android (Google) Code Review
9 changed files with 72 additions and 0 deletions

View File

@@ -114,4 +114,19 @@ public class MagnificationGesturesPreferenceControllerTest {
Settings.Secure.ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED, -1))
.isEqualTo(OFF);
}
@Test
public void isSliceableCorrectKey_returnsTrue() {
final MagnificationGesturesPreferenceController controller =
new MagnificationGesturesPreferenceController(mContext,
"screen_magnification_gestures_preference_screen");
assertThat(controller.isSliceable()).isTrue();
}
@Test
public void isSliceableIncorrectKey_returnsFalse() {
final MagnificationGesturesPreferenceController controller =
new MagnificationGesturesPreferenceController(mContext, "bad_key");
assertThat(controller.isSliceable()).isFalse();
}
}

View File

@@ -158,4 +158,19 @@ public class MagnificationNavbarPreferenceControllerTest {
sIsApplicable = applicable;
}
}
@Test
public void isSliceableCorrectKey_returnsTrue() {
final MagnificationNavbarPreferenceController controller =
new MagnificationNavbarPreferenceController(mContext,
"screen_magnification_navbar_preference_screen");
assertThat(controller.isSliceable()).isTrue();
}
@Test
public void isSliceableIncorrectKey_returnsFalse() {
final MagnificationNavbarPreferenceController controller =
new MagnificationNavbarPreferenceController(mContext, "bad_key");
assertThat(controller.isSliceable()).isFalse();
}
}

View File

@@ -115,4 +115,11 @@ public class SmartBatteryPreferenceControllerTest {
return Settings.Global.getInt(mContentResolver,
Settings.Global.ADAPTIVE_BATTERY_MANAGEMENT_ENABLED, ON);
}
@Test
public void isSliceableCorrectKey_returnsTrue() {
final SmartBatteryPreferenceController controller =
new SmartBatteryPreferenceController(mContext);
assertThat(controller.isSliceable()).isTrue();
}
}

View File

@@ -73,4 +73,9 @@ public class AlarmVolumePreferenceControllerTest {
public void getAudioStream_shouldReturnAlarm() {
assertThat(mController.getAudioStream()).isEqualTo(AudioManager.STREAM_ALARM);
}
@Test
public void isSliceableCorrectKey_returnsTrue() {
assertThat(mController.isSliceable()).isTrue();
}
}