Add Settings keywords for Styles & Wallpaper.

Reusing existing strings since this is coming in after string freeze.
TODO: create a new keyword string for this preference.

Fixes: 130759285
Test: m RunSettingsRoboTests and searching keywords on device
Change-Id: Ice1bc34b381302745cb55056377cc94ea74e8d50
This commit is contained in:
Amin Shaikh
2019-04-18 11:13:01 -04:00
parent 3683a688f7
commit 87ef55ea90
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(