Register most app info related controllers in xml

Bug: 77216595
Test: robotests
Change-Id: I79afa38820b7518d8b3112148802797ebcf6d184
This commit is contained in:
Fan Zhang
2018-03-29 15:45:49 -07:00
parent 65983f71d5
commit b5c651c939
40 changed files with 299 additions and 249 deletions

View File

@@ -44,12 +44,12 @@ public class PreferenceCategoryControllerTest {
public void setUp() {
mContext = RuntimeEnvironment.application;
mChildren = new ArrayList<>();
mController = new PreferenceCategoryController(mContext, "pref_key", mChildren);
mController = new PreferenceCategoryController(mContext, "pref_key").setChildren(mChildren);
}
@Test
public void isAvailable_noChildren_true() {
assertThat(mController.isAvailable()).isTrue();
public void isAvailable_noChildren_false() {
assertThat(mController.isAvailable()).isFalse();
}
@Test
@@ -57,6 +57,7 @@ public class PreferenceCategoryControllerTest {
final AbstractPreferenceController child = mock(AbstractPreferenceController.class);
when(child.isAvailable()).thenReturn(true);
mChildren.add(child);
mController.setChildren(mChildren);
assertThat(mController.isAvailable()).isTrue();
}
@@ -66,6 +67,7 @@ public class PreferenceCategoryControllerTest {
final AbstractPreferenceController child = mock(AbstractPreferenceController.class);
when(child.isAvailable()).thenReturn(false);
mChildren.add(child);
mController.setChildren(mChildren);
assertThat(mController.isAvailable()).isFalse();
}