Loading tests/robotests/src/com/android/settings/notification/BubbleNotificationPreferenceControllerTest.java +5 −5 Original line number Diff line number Diff line Loading @@ -46,7 +46,6 @@ import androidx.preference.TwoStatePreference; @RunWith(RobolectricTestRunner.class) public class BubbleNotificationPreferenceControllerTest { @Mock(answer = Answers.RETURNS_DEEP_STUBS) private Context mContext; @Mock(answer = Answers.RETURNS_DEEP_STUBS) private PreferenceScreen mScreen; Loading @@ -59,6 +58,7 @@ public class BubbleNotificationPreferenceControllerTest { @Before public void setUp() { MockitoAnnotations.initMocks(this); mContext = RuntimeEnvironment.application; mController = new BubbleNotificationPreferenceController(mContext, KEY_NOTIFICATION_BUBBLES); mPreference = new Preference(RuntimeEnvironment.application); Loading @@ -74,8 +74,7 @@ public class BubbleNotificationPreferenceControllerTest { @Test public void updateState_preferenceSetCheckedWhenSettingIsOn() { final TwoStatePreference preference = mock(TwoStatePreference.class); final Context context = RuntimeEnvironment.application; Settings.Secure.putInt(context.getContentResolver(), NOTIFICATION_BUBBLES, ON); Settings.Secure.putInt(mContext.getContentResolver(), NOTIFICATION_BUBBLES, ON); mController.updateState(preference); Loading @@ -85,8 +84,9 @@ public class BubbleNotificationPreferenceControllerTest { @Test public void updateState_preferenceSetUncheckedWhenSettingIsOff() { final TwoStatePreference preference = mock(TwoStatePreference.class); final Context context = RuntimeEnvironment.application; Settings.Secure.putInt(context.getContentResolver(), NOTIFICATION_BUBBLES, OFF); Settings.Secure.putInt(mContext.getContentResolver(), NOTIFICATION_BUBBLES, OFF); assertThat(Settings.Secure.getInt(mContext.getContentResolver(), NOTIFICATION_BUBBLES, ON)).isEqualTo(OFF); mController.updateState(preference); Loading Loading
tests/robotests/src/com/android/settings/notification/BubbleNotificationPreferenceControllerTest.java +5 −5 Original line number Diff line number Diff line Loading @@ -46,7 +46,6 @@ import androidx.preference.TwoStatePreference; @RunWith(RobolectricTestRunner.class) public class BubbleNotificationPreferenceControllerTest { @Mock(answer = Answers.RETURNS_DEEP_STUBS) private Context mContext; @Mock(answer = Answers.RETURNS_DEEP_STUBS) private PreferenceScreen mScreen; Loading @@ -59,6 +58,7 @@ public class BubbleNotificationPreferenceControllerTest { @Before public void setUp() { MockitoAnnotations.initMocks(this); mContext = RuntimeEnvironment.application; mController = new BubbleNotificationPreferenceController(mContext, KEY_NOTIFICATION_BUBBLES); mPreference = new Preference(RuntimeEnvironment.application); Loading @@ -74,8 +74,7 @@ public class BubbleNotificationPreferenceControllerTest { @Test public void updateState_preferenceSetCheckedWhenSettingIsOn() { final TwoStatePreference preference = mock(TwoStatePreference.class); final Context context = RuntimeEnvironment.application; Settings.Secure.putInt(context.getContentResolver(), NOTIFICATION_BUBBLES, ON); Settings.Secure.putInt(mContext.getContentResolver(), NOTIFICATION_BUBBLES, ON); mController.updateState(preference); Loading @@ -85,8 +84,9 @@ public class BubbleNotificationPreferenceControllerTest { @Test public void updateState_preferenceSetUncheckedWhenSettingIsOff() { final TwoStatePreference preference = mock(TwoStatePreference.class); final Context context = RuntimeEnvironment.application; Settings.Secure.putInt(context.getContentResolver(), NOTIFICATION_BUBBLES, OFF); Settings.Secure.putInt(mContext.getContentResolver(), NOTIFICATION_BUBBLES, OFF); assertThat(Settings.Secure.getInt(mContext.getContentResolver(), NOTIFICATION_BUBBLES, ON)).isEqualTo(OFF); mController.updateState(preference); Loading