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

am: 670bf45b50

Change-Id: I4a5e50cf64660601bc8864be4c8fcf04f5ae1c83
This commit is contained in:
Amin Shaikh
2019-04-18 12:32:55 -07:00
committed by android-build-merger
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(