Merge "Add test for null-pointer in ZenModeHelperTest"
This commit is contained in:
committed by
Android (Google) Code Review
commit
39ff4f893d
@@ -1030,6 +1030,14 @@ public class ZenModeHelperTest extends UiServiceTestCase {
|
||||
assertEquals(1, mZenModeHelperSpy.mConditions.mSubscriptions.size());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEmptyDefaultRulesMap() {
|
||||
ZenModeConfig config = new ZenModeConfig();
|
||||
config.automaticRules = new ArrayMap<>();
|
||||
mZenModeHelperSpy.mConfig = config;
|
||||
mZenModeHelperSpy.updateDefaultZenRules(); // shouldn't throw null pointer
|
||||
}
|
||||
|
||||
private void setupZenConfig() {
|
||||
mZenModeHelperSpy.mZenMode = Settings.Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS;
|
||||
mZenModeHelperSpy.mConfig.allowAlarms = false;
|
||||
|
||||
Reference in New Issue
Block a user