Merge changes I868d1912,Id483ca41

* changes:
  Fix search test using location_settings
  Revert "Stop search tests using location_settings"
This commit is contained in:
Neil Fuller
2020-10-23 09:24:43 +00:00
committed by Android (Google) Code Review
2 changed files with 9 additions and 1 deletions

View File

@@ -39,6 +39,7 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.RuntimeEnvironment;
import org.robolectric.annotation.Config;
@RunWith(RobolectricTestRunner.class)
public class SearchIndexableResourcesTest {
@@ -89,6 +90,7 @@ public class SearchIndexableResourcesTest {
}
@Test
@Config(qualifiers = "mcc999")
public void testNonIndexableKeys_GetsKeyFromProvider() {
mSearchProvider.getSearchIndexableResources().getProviderValues().clear();
mSearchProvider.getSearchIndexableResources().addIndex(

View File

@@ -29,8 +29,14 @@ public class FakeIndexProvider implements Indexable {
public static final String KEY = "TestKey";
/**
* The fake SearchIndexProvider. Note that the use of location_settings below implies that tests
* using this should be using the res/xml-mcc999/location_settings.xml or
* res/xml-mcc998/location_settings.xml. Annotate tests with
* {@code @Config(qualifiers = "mcc999")}.
*/
public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
new BaseSearchIndexProvider(R.xml.sound_settings) {
new BaseSearchIndexProvider(R.xml.location_settings) {
@Override
public List<String> getNonIndexableKeys(Context context) {