Merge "Add Settings keywords for Styles & Wallpaper." into qt-dev

This commit is contained in:
TreeHugger Robot
2019-04-18 18:43:35 +00:00
committed by Android (Google) Code Review
3 changed files with 58 additions and 17 deletions

View File

@@ -115,6 +115,30 @@ public class WallpaperPreferenceControllerTest {
assertThat(mController.areStylesAvailable()).isTrue();
}
@Test
public void getKeywords_withoutStyles() {
mShadowPackageManager.setResolveInfosForIntent(
mStylesAndWallpaperIntent, Lists.newArrayList());
assertThat(mController.getKeywords())
.contains(mContext.getString(R.string.keywords_wallpaper));
assertThat(mController.getKeywords())
.doesNotContain(mContext.getString(R.string.theme_customization_category));
}
@Test
public void getKeywords_withStyles() {
mShadowPackageManager.setResolveInfosForIntent(
mStylesAndWallpaperIntent,
Lists.newArrayList(mock(ResolveInfo.class)));
assertThat(mController.areStylesAvailable()).isTrue();
assertThat(mController.getKeywords())
.contains(mContext.getString(R.string.keywords_wallpaper));
assertThat(mController.getKeywords())
.contains(mContext.getString(R.string.theme_customization_category));
}
@Test
public void handlePreferenceTreeClick_wallpaperOnly() {
mShadowPackageManager.setResolveInfosForIntent(