Merge "Fix null pointer exception when logging suggestions." into oc-mr1-dev am: d94fbbc325
am: c2eab36c7c
Change-Id: I09efabd3f8a4a7358f2b6a6d52a15fdd75ca7672
This commit is contained in:
@@ -318,6 +318,21 @@ public class DashboardAdapterTest {
|
||||
assertThat(mActionCategoryCaptor.getAllValues().toArray()).isEqualTo(expectedActions);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSuggestionsLogs_nullSuggestionsList_shouldNotCrash() {
|
||||
setupSuggestions(makeSuggestions("pkg1", "pkg2", "pkg3", "pkg4", "pkg5"));
|
||||
mDashboardAdapter.onBindSuggestionConditionHeader(mSuggestionHolder, mSuggestionHeaderData);
|
||||
|
||||
// set suggestions to null
|
||||
final DashboardData prevData = mDashboardAdapter.mDashboardData;
|
||||
mDashboardAdapter.mDashboardData = new DashboardData.Builder(prevData)
|
||||
.setSuggestions(null)
|
||||
.build();
|
||||
|
||||
mSuggestionHolder.itemView.callOnClick();
|
||||
// no crash
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSuggestionDismissed_notOnlySuggestion_updateSuggestionOnly() {
|
||||
final DashboardAdapter adapter =
|
||||
|
Reference in New Issue
Block a user