Merge "Add NPE check for refreshUi" into oc-dev

This commit is contained in:
Lei Yu
2017-05-25 19:51:13 +00:00
committed by Android (Google) Code Review
2 changed files with 17 additions and 5 deletions

View File

@@ -344,6 +344,14 @@ public class AppButtonsPreferenceControllerTest {
assertThat(controllable).isTrue();
}
@Test
public void testRefreshUi_packageNull_shouldNotCrash() {
mController.mPackageName = null;
// Should not crash in this method
assertThat(mController.refreshUi()).isFalse();
}
/**
* The test fragment which implements
* {@link ButtonActionDialogFragment.AppButtonsDialogListener}