Fix search test using location_settings

Second attempt to proactively fix a search test.

SearchIndexableResourcesTest uses the FakeIndexProvider, which
implicitly assumes that the
robotests/res/xml-mcc999/location_settings.xml xml is in use. Without
it, the test is accessing the real location_settings.xml / real
preference controllers. This  was working until now, but by luck and
probably not intent.

There is an upcoming change which will break the test, so this fixes the
test ahead of time.

This change updates the test to use the "mcc999" config, and improves
the docs around FakeIndexProvider to try to make the requirements for
use clearer.

Bug: 171371424
Test: m RunSettingsRoboTests
Change-Id: I868d191281a2030fa49134893bcd6720f757ea91
This commit is contained in:
Neil Fuller
2020-10-22 15:08:38 +01:00
parent d11f93babe
commit 94a64d6139
2 changed files with 8 additions and 0 deletions

View File

@@ -29,6 +29,12 @@ 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.location_settings) {