Finalize strings for enterprise privacy

A few more final string tweaks for the enterprise privacy page.

Bug: 32692748
Test: m RunSettingsRoboTests

Change-Id: Icf91a1188febb303fb1a9e9a5259a06c3b2324da
This commit is contained in:
Bartosz Fabianowski
2017-03-21 11:19:38 +01:00
parent 7896f10920
commit e39e8350a1
6 changed files with 25 additions and 51 deletions

View File

@@ -43,10 +43,8 @@ import static org.mockito.Mockito.when;
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
public final class CaCertsCurrentUserPreferenceControllerTest {
private final String INSTALLED_CERTS_USER_1 = "cert installed";
private final String INSTALLED_CERTS_USER_10 = "certs installed";
private final String INSTALLED_CERTS_PERSONAL_1 = "cert installed in personal profile";
private final String INSTALLED_CERTS_PERSONAL_10 = "certs installed in personal profile";
private final String INSTALLED_CERTS_USER = "trusted credentials";
private final String INSTALLED_CERTS_PERSONAL = "trusted credentials in personal profile";
private final String NUMBER_INSTALLED_CERTS_1 = "1 cert";
private final String NUMBER_INSTALLED_CERTS_10 = "10 certs";
@@ -63,16 +61,10 @@ public final class CaCertsCurrentUserPreferenceControllerTest {
mFeatureFactory = (FakeFeatureFactory) FakeFeatureFactory.getFactory(mContext);
mController = new CaCertsCurrentUserPreferenceController(mContext);
when(mContext.getResources().getQuantityString(R.plurals.enterprise_privacy_ca_certs_user,
1)).thenReturn(INSTALLED_CERTS_USER_1);
when(mContext.getResources().getQuantityString(R.plurals.enterprise_privacy_ca_certs_user,
10)).thenReturn(INSTALLED_CERTS_USER_10);
when(mContext.getResources().getQuantityString(
R.plurals.enterprise_privacy_ca_certs_personal, 1))
.thenReturn(INSTALLED_CERTS_PERSONAL_1);
when(mContext.getResources().getQuantityString(
R.plurals.enterprise_privacy_ca_certs_personal, 10))
.thenReturn(INSTALLED_CERTS_PERSONAL_10);
when(mContext.getString(R.string.enterprise_privacy_ca_certs_user))
.thenReturn(INSTALLED_CERTS_USER);
when(mContext.getString(R.string.enterprise_privacy_ca_certs_personal))
.thenReturn(INSTALLED_CERTS_PERSONAL);
when(mContext.getResources().getQuantityString(R.plurals.enterprise_privacy_number_ca_certs,
1, 1)).thenReturn(NUMBER_INSTALLED_CERTS_1);
when(mContext.getResources().getQuantityString(R.plurals.enterprise_privacy_number_ca_certs,
@@ -95,7 +87,7 @@ public final class CaCertsCurrentUserPreferenceControllerTest {
.getNumberOfOwnerInstalledCaCertsInCurrentUser()).thenReturn(1);
mController.updateState(preference);
assertThat(preference.isVisible()).isTrue();
assertThat(preference.getTitle()).isEqualTo(INSTALLED_CERTS_USER_1);
assertThat(preference.getTitle()).isEqualTo(INSTALLED_CERTS_USER);
assertThat(preference.getSummary()).isEqualTo(NUMBER_INSTALLED_CERTS_1);
preference.setVisible(false);
@@ -103,7 +95,7 @@ public final class CaCertsCurrentUserPreferenceControllerTest {
.getNumberOfOwnerInstalledCaCertsInCurrentUser()).thenReturn(10);
mController.updateState(preference);
assertThat(preference.isVisible()).isTrue();
assertThat(preference.getTitle()).isEqualTo(INSTALLED_CERTS_USER_10);
assertThat(preference.getTitle()).isEqualTo(INSTALLED_CERTS_USER);
assertThat(preference.getSummary()).isEqualTo(NUMBER_INSTALLED_CERTS_10);
when(mFeatureFactory.enterprisePrivacyFeatureProvider.isInCompMode()).thenReturn(true);
@@ -117,7 +109,7 @@ public final class CaCertsCurrentUserPreferenceControllerTest {
.getNumberOfOwnerInstalledCaCertsInCurrentUser()).thenReturn(1);
mController.updateState(preference);
assertThat(preference.isVisible()).isTrue();
assertThat(preference.getTitle()).isEqualTo(INSTALLED_CERTS_PERSONAL_1);
assertThat(preference.getTitle()).isEqualTo(INSTALLED_CERTS_PERSONAL);
assertThat(preference.getSummary()).isEqualTo(NUMBER_INSTALLED_CERTS_1);
preference.setVisible(false);
@@ -125,7 +117,7 @@ public final class CaCertsCurrentUserPreferenceControllerTest {
.getNumberOfOwnerInstalledCaCertsInCurrentUser()).thenReturn(10);
mController.updateState(preference);
assertThat(preference.isVisible()).isTrue();
assertThat(preference.getTitle()).isEqualTo(INSTALLED_CERTS_PERSONAL_10);
assertThat(preference.getTitle()).isEqualTo(INSTALLED_CERTS_PERSONAL);
assertThat(preference.getSummary()).isEqualTo(NUMBER_INSTALLED_CERTS_10);
}

View File

@@ -43,8 +43,6 @@ import static org.mockito.Mockito.when;
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
public final class CaCertsManagedProfilePreferenceControllerTest {
private final String INSTALLED_CERTS_1 = "cert installed";
private final String INSTALLED_CERTS_10 = "certs installed";
private final String NUMBER_INSTALLED_CERTS_1 = "1 cert";
private final String NUMBER_INSTALLED_CERTS_10 = "10 certs";
@@ -61,10 +59,6 @@ public final class CaCertsManagedProfilePreferenceControllerTest {
mFeatureFactory = (FakeFeatureFactory) FakeFeatureFactory.getFactory(mContext);
mController = new CaCertsManagedProfilePreferenceController(mContext);
when(mContext.getResources().getQuantityString(R.plurals.enterprise_privacy_ca_certs_work,
1)).thenReturn(INSTALLED_CERTS_1);
when(mContext.getResources().getQuantityString(R.plurals.enterprise_privacy_ca_certs_work,
10)).thenReturn(INSTALLED_CERTS_10);
when(mContext.getResources().getQuantityString(R.plurals.enterprise_privacy_number_ca_certs,
1, 1)).thenReturn(NUMBER_INSTALLED_CERTS_1);
when(mContext.getResources().getQuantityString(R.plurals.enterprise_privacy_number_ca_certs,
@@ -85,7 +79,6 @@ public final class CaCertsManagedProfilePreferenceControllerTest {
.getNumberOfOwnerInstalledCaCertsInManagedProfile()).thenReturn(1);
mController.updateState(preference);
assertThat(preference.isVisible()).isTrue();
assertThat(preference.getTitle()).isEqualTo(INSTALLED_CERTS_1);
assertThat(preference.getSummary()).isEqualTo(NUMBER_INSTALLED_CERTS_1);
preference.setVisible(false);
@@ -93,7 +86,6 @@ public final class CaCertsManagedProfilePreferenceControllerTest {
.getNumberOfOwnerInstalledCaCertsInManagedProfile()).thenReturn(10);
mController.updateState(preference);
assertThat(preference.isVisible()).isTrue();
assertThat(preference.getTitle()).isEqualTo(INSTALLED_CERTS_10);
assertThat(preference.getSummary()).isEqualTo(NUMBER_INSTALLED_CERTS_10);
}