Merge "Fix crash in Monkey test." into pi-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
d95668db99
@@ -149,6 +149,19 @@ public class BatteryTipPreferenceControllerTest {
|
||||
assertOnlyContainsSummaryTip(mPreferenceGroup);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRestoreFromNull_shouldNotCrash() {
|
||||
final Bundle bundle = new Bundle();
|
||||
// Battery tip list is null at this time
|
||||
mBatteryTipPreferenceController.saveInstanceState(bundle);
|
||||
|
||||
final BatteryTipPreferenceController controller = new BatteryTipPreferenceController(
|
||||
mContext, KEY_PREF, mSettingsActivity, mFragment, mBatteryTipListener);
|
||||
|
||||
// Should not crash
|
||||
controller.restoreInstanceState(bundle);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testHandlePreferenceTreeClick_noDialog_invokeCallback() {
|
||||
when(mBatteryTip.getType()).thenReturn(SMART_BATTERY_MANAGER);
|
||||
|
Reference in New Issue
Block a user