Merge "Autogenerate SearchIndexableResources subclass"

This commit is contained in:
TreeHugger Robot
2018-04-03 20:11:26 +00:00
committed by Android (Google) Code Review
85 changed files with 169 additions and 233 deletions

View File

@@ -38,7 +38,8 @@ LOCAL_JAVA_LIBRARIES := \
LOCAL_TEST_PACKAGE := Settings
LOCAL_INSTRUMENT_SOURCE_DIRS := $(dir $(LOCAL_PATH))../src
LOCAL_INSTRUMENT_SOURCE_DIRS := $(dir $(LOCAL_PATH))../src \
frameworks/base/packages/SettingsLib/search/src \
LOCAL_ROBOTEST_TIMEOUT := 36000

View File

@@ -25,6 +25,7 @@ import android.util.Log;
import com.android.settings.SettingsPreferenceFragment;
import com.android.settings.core.codeinspection.CodeInspector;
import com.android.settings.dashboard.DashboardFragmentSearchIndexProviderInspector;
import com.android.settingslib.search.SearchIndexableResources;
import org.robolectric.RuntimeEnvironment;

View File

@@ -17,8 +17,11 @@
package com.android.settings.search;
import static android.provider.SearchIndexablesContract.COLUMN_INDEX_NON_INDEXABLE_KEYS_KEY_VALUE;
import static com.google.common.truth.Truth.assertThat;
import static junit.framework.Assert.fail;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.when;
@@ -62,8 +65,7 @@ public class SearchIndexableResourcesTest {
final int beforeCount =
mSearchProvider.getSearchIndexableResources().getProviderValues().size();
((SearchIndexableResourcesImpl) mSearchProvider.getSearchIndexableResources())
.addIndex(String.class);
mSearchProvider.getSearchIndexableResources().addIndex(String.class);
assertThat(mSearchProvider.getSearchIndexableResources().getProviderValues())
.contains(String.class);
@@ -81,8 +83,7 @@ public class SearchIndexableResourcesTest {
@Test
public void testNonIndexableKeys_GetsKeyFromProvider() {
mSearchProvider.getSearchIndexableResources().getProviderValues().clear();
((SearchIndexableResourcesImpl) mSearchProvider.getSearchIndexableResources())
.addIndex(FakeIndexProvider.class);
mSearchProvider.getSearchIndexableResources().addIndex(FakeIndexProvider.class);
SettingsSearchIndexablesProvider provider = spy(new SettingsSearchIndexablesProvider());