Merge "Introduce ClearAdbKeysPreferenceController"

This commit is contained in:
Jeffrey Huang
2017-10-03 16:48:56 +00:00
committed by Android (Google) Code Review
6 changed files with 422 additions and 3 deletions

View File

@@ -114,7 +114,8 @@ public class DevelopmentSettingsDashboardFragmentTest {
@Config(shadows = {
ShadowPictureColorModePreferenceController.class,
ShadowAdbPreferenceController.class,
ShadowBluetoothInbandRingingPreferenceController.class
ShadowBluetoothInbandRingingPreferenceController.class,
ShadowClearAdbKeysPreferenceController.class
})
public void searchIndex_pageEnabled_shouldNotAddKeysToNonIndexable() {
final Context appContext = RuntimeEnvironment.application;
@@ -207,6 +208,17 @@ public class DevelopmentSettingsDashboardFragmentTest {
verify(controller).onAdbDialogDismissed();
}
@Test
public void onAdbClearKeysDialogConfirmed_shouldCallControllerDialogConfirmed() {
final ClearAdbKeysPreferenceController controller = mock(
ClearAdbKeysPreferenceController.class);
doReturn(controller).when(mDashboard).getDevelopmentOptionsController(
ClearAdbKeysPreferenceController.class);
mDashboard.onAdbClearKeysDialogConfirmed();
verify(controller).onClearAdbKeysConfirmed();
}
@Implements(EnableDevelopmentSettingWarningDialog.class)
public static class ShadowEnableDevelopmentSettingWarningDialog {
@@ -247,4 +259,13 @@ public class DevelopmentSettingsDashboardFragmentTest {
return true;
}
}
@Implements(ClearAdbKeysPreferenceController.class)
public static class ShadowClearAdbKeysPreferenceController {
@Implementation
public boolean isAvailable() {
return true;
}
}
}