Search in sources :

Example 51 with SummaryLoader

use of com.android.settings.dashboard.SummaryLoader in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class ConfigureNotificationSettingsTest method getSummary_noneBlocked.

@Test
public void getSummary_noneBlocked() {
    SummaryLoader loader = mock(SummaryLoader.class);
    NotificationBackend backend = mock(NotificationBackend.class);
    when(backend.getBlockedAppCount()).thenReturn(0);
    SummaryProvider provider = (SummaryProvider) SUMMARY_PROVIDER_FACTORY.createSummaryProvider(mActivity, loader);
    provider.setBackend(backend);
    provider.setListening(true);
    ArgumentCaptor<CharSequence> captor = ArgumentCaptor.forClass(CharSequence.class);
    verify(loader).setSummary(any(), captor.capture());
    assertThat(captor.getValue().toString()).contains("On");
}
Also used : SummaryProvider(com.android.settings.notification.ConfigureNotificationSettings.SummaryProvider) SummaryLoader(com.android.settings.dashboard.SummaryLoader) Test(org.junit.Test)

Aggregations

SummaryLoader (com.android.settings.dashboard.SummaryLoader)51 Test (org.junit.Test)51 Activity (android.app.Activity)13 ComponentName (android.content.ComponentName)7 ContentResolver (android.content.ContentResolver)7 InputMethodInfo (android.view.inputmethod.InputMethodInfo)7 ArrayList (java.util.ArrayList)7 StorageStatsManager (android.app.usage.StorageStatsManager)6 UserInfo (android.content.pm.UserInfo)6 NfcAdapter (android.nfc.NfcAdapter)6 NfcManager (android.nfc.NfcManager)6 VolumeInfo (android.os.storage.VolumeInfo)6 TestConfig (com.android.settings.TestConfig)6 DefaultBrowserPreferenceController (com.android.settings.applications.defaultapps.DefaultBrowserPreferenceController)6 DefaultPhonePreferenceController (com.android.settings.applications.defaultapps.DefaultPhonePreferenceController)6 DefaultSmsPreferenceController (com.android.settings.applications.defaultapps.DefaultSmsPreferenceController)6 Config (org.robolectric.annotation.Config)6 SummaryProvider (com.android.settings.notification.ConfigureNotificationSettings.SummaryProvider)2