Search in sources :

Example 1 with SearchFeatureProvider

use of com.android.settings.search.SearchFeatureProvider in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class SlicesDatabaseAccessorTest method getSliceKeys_indexesDatabase.

@Test
@Config(qualifiers = "mcc999")
public void getSliceKeys_indexesDatabase() {
    // Force new indexing
    Locale.setDefault(new Locale("ca"));
    final SearchFeatureProvider provider = new SearchFeatureProviderImpl();
    final SlicesFeatureProvider sliceProvider = spy(new SlicesFeatureProviderImpl());
    final FakeFeatureFactory factory = FakeFeatureFactory.setupForTest();
    factory.searchFeatureProvider = provider;
    factory.slicesFeatureProvider = sliceProvider;
    // Fake the indexable list.
    provider.getSearchIndexableResources().getProviderValues().clear();
    provider.getSearchIndexableResources().getProviderValues().add(FakeIndexProvider.class);
    final SlicesDatabaseAccessor accessor = new SlicesDatabaseAccessor(mContext);
    final List<String> keys = accessor.getSliceKeys(true);
    assertThat(keys).isNotEmpty();
}
Also used : Locale(java.util.Locale) SearchFeatureProviderImpl(com.android.settings.search.SearchFeatureProviderImpl) SearchFeatureProvider(com.android.settings.search.SearchFeatureProvider) FakeFeatureFactory(com.android.settings.testutils.FakeFeatureFactory) Test(org.junit.Test) Config(org.robolectric.annotation.Config)

Aggregations

SearchFeatureProvider (com.android.settings.search.SearchFeatureProvider)1 SearchFeatureProviderImpl (com.android.settings.search.SearchFeatureProviderImpl)1 FakeFeatureFactory (com.android.settings.testutils.FakeFeatureFactory)1 Locale (java.util.Locale)1 Test (org.junit.Test)1 Config (org.robolectric.annotation.Config)1