Merge "Fix crash from Settings Search"

This commit is contained in:
TreeHugger Robot
2017-10-20 23:00:42 +00:00
committed by Android (Google) Code Review
3 changed files with 18 additions and 2 deletions

View File

@@ -334,6 +334,17 @@ public class IndexDataConverterTest {
assertThat(nonTitlePref.enabled).isTrue();
}
@Test
public void testResourceWithoutXml_shouldNotCrash() {
final SearchIndexableResource resource = getFakeResource(0);
final PreIndexData preIndexData = new PreIndexData();
preIndexData.dataToUpdate.add(resource);
List<IndexData> indexData = mConverter.convertPreIndexDataToIndexData(preIndexData);
assertThat(indexData).isEmpty();
}
private void assertDisplaySetting(IndexData row, String title, String summaryOn,
String summaryOff, String key) {
assertThat(row.normalizedTitle).isEqualTo(title);