Fix null pointer in dashboard fragment test.
- use context instead of activity to retrieve resource details. - revert the change previously made in getActivity() calls. - add null checking in package name and tile intent. Fix: 34396855 Test: make RunSettingsRoboTests Change-Id: Ic853939fee3c381b663c0320354da51d3b2a0e11
This commit is contained in:
@@ -79,6 +79,7 @@ public class DashboardFragmentTest {
|
||||
when(mFakeFeatureFactory.dashboardFeatureProvider.getTilesForCategory(anyString()))
|
||||
.thenReturn(mDashboardCategory);
|
||||
mTestFragment.onAttach(ShadowApplication.getInstance().getApplicationContext());
|
||||
when(mContext.getPackageName()).thenReturn("TestPackage");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Reference in New Issue
Block a user