Merge "Add divider line below "see all apps" preference"

This commit is contained in:
TreeHugger Robot
2017-06-15 23:09:27 +00:00
committed by Android (Google) Code Review
3 changed files with 20 additions and 1 deletions

View File

@@ -68,6 +68,8 @@ public class RecentAppsPreferenceControllerTest {
private PreferenceCategory mCategory;
@Mock
private Preference mSeeAllPref;
@Mock
private PreferenceCategory mDivider;
@Mock(answer = Answers.RETURNS_DEEP_STUBS)
private Context mMockContext;
@Mock
@@ -94,6 +96,8 @@ public class RecentAppsPreferenceControllerTest {
when(mScreen.findPreference(RecentAppsPreferenceController.KEY_SEE_ALL))
.thenReturn(mSeeAllPref);
when(mScreen.findPreference(RecentAppsPreferenceController.KEY_DIVIDER))
.thenReturn(mDivider);
when(mCategory.getContext()).thenReturn(mContext);
}
@@ -108,7 +112,8 @@ public class RecentAppsPreferenceControllerTest {
mController.updateNonIndexableKeys(nonIndexable);
assertThat(nonIndexable).containsExactly(mController.getPreferenceKey());
assertThat(nonIndexable).containsAllOf(mController.getPreferenceKey(),
RecentAppsPreferenceController.KEY_DIVIDER);
}
@Test
@@ -136,6 +141,7 @@ public class RecentAppsPreferenceControllerTest {
verify(mCategory).setTitle(null);
verify(mSeeAllPref).setTitle(R.string.applications_settings);
verify(mSeeAllPref).setIcon(null);
verify(mDivider).setVisible(false);
}
@Test
@@ -180,6 +186,7 @@ public class RecentAppsPreferenceControllerTest {
verify(mSeeAllPref).setSummary(null);
verify(mSeeAllPref).setIcon(R.drawable.ic_chevron_right_24dp);
verify(mDivider).setVisible(true);
}
@Test