From d5a6030fd24dc647aad5738405b3e9acf50462c7 Mon Sep 17 00:00:00 2001 From: Yo Chiang Date: Mon, 27 Jul 2020 11:50:34 +0800 Subject: [PATCH] =?UTF-8?q?Update=20language=20to=20comply=20with=20Androi?= =?UTF-8?q?d=E2=80=99s=20inclusive=20language=20guidance?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://source.android.com/setup/contribute/respectful-code for reference #inclusivefixit Bug: 161896447 Test: TH presubmit Test: atest DynamicSystemInstallationServiceTests Change-Id: I94ab7cabc4f86ecb266c1d7d89357da1e3f88921 --- .../tests/res/values/strings.xml | 2 +- .../dynsystem/KeyRevocationListTest.java | 46 +++++++++---------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/packages/DynamicSystemInstallationService/tests/res/values/strings.xml b/packages/DynamicSystemInstallationService/tests/res/values/strings.xml index fdb620bfe094a..019c0c9147714 100644 --- a/packages/DynamicSystemInstallationService/tests/res/values/strings.xml +++ b/packages/DynamicSystemInstallationService/tests/res/values/strings.xml @@ -1,7 +1,7 @@ - + { \"entries\":[ { diff --git a/packages/DynamicSystemInstallationService/tests/src/com/android/dynsystem/KeyRevocationListTest.java b/packages/DynamicSystemInstallationService/tests/src/com/android/dynsystem/KeyRevocationListTest.java index 82ce542cf5de6..c1233ebab2ec0 100644 --- a/packages/DynamicSystemInstallationService/tests/src/com/android/dynsystem/KeyRevocationListTest.java +++ b/packages/DynamicSystemInstallationService/tests/src/com/android/dynsystem/KeyRevocationListTest.java @@ -47,32 +47,32 @@ public class KeyRevocationListTest { private static Context sContext; - private static String sBlacklistJsonString; + private static String sBlocklistJsonString; @BeforeClass public static void setUpClass() throws Exception { sContext = InstrumentationRegistry.getInstrumentation().getContext(); - sBlacklistJsonString = - sContext.getString(com.android.dynsystem.tests.R.string.blacklist_json_string); + sBlocklistJsonString = + sContext.getString(com.android.dynsystem.tests.R.string.blocklist_json_string); } @Test @SmallTest public void testFromJsonString() throws JSONException { - KeyRevocationList blacklist; - blacklist = KeyRevocationList.fromJsonString(sBlacklistJsonString); - Assert.assertNotNull(blacklist); - Assert.assertFalse(blacklist.mEntries.isEmpty()); - blacklist = KeyRevocationList.fromJsonString("{}"); - Assert.assertNotNull(blacklist); - Assert.assertTrue(blacklist.mEntries.isEmpty()); + KeyRevocationList blocklist; + blocklist = KeyRevocationList.fromJsonString(sBlocklistJsonString); + Assert.assertNotNull(blocklist); + Assert.assertFalse(blocklist.mEntries.isEmpty()); + blocklist = KeyRevocationList.fromJsonString("{}"); + Assert.assertNotNull(blocklist); + Assert.assertTrue(blocklist.mEntries.isEmpty()); } @Test @SmallTest public void testFromUrl() throws IOException, JSONException { URLConnection mockConnection = mock(URLConnection.class); - doReturn(new ByteArrayInputStream(sBlacklistJsonString.getBytes())) + doReturn(new ByteArrayInputStream(sBlocklistJsonString.getBytes())) .when(mockConnection).getInputStream(); URL mockUrl = new URL( "http", // protocol @@ -97,36 +97,36 @@ public class KeyRevocationListTest { } }); - KeyRevocationList blacklist = KeyRevocationList.fromUrl(mockUrl); - Assert.assertNotNull(blacklist); - Assert.assertFalse(blacklist.mEntries.isEmpty()); + KeyRevocationList blocklist = KeyRevocationList.fromUrl(mockUrl); + Assert.assertNotNull(blocklist); + Assert.assertFalse(blocklist.mEntries.isEmpty()); - blacklist = null; + blocklist = null; try { - blacklist = KeyRevocationList.fromUrl(mockBadUrl); + blocklist = KeyRevocationList.fromUrl(mockBadUrl); // Up should throw, down should be unreachable Assert.fail("Expected IOException not thrown"); } catch (IOException e) { // This is expected, do nothing } - Assert.assertNull(blacklist); + Assert.assertNull(blocklist); } @Test @SmallTest public void testIsRevoked() { - KeyRevocationList blacklist = new KeyRevocationList(); - blacklist.addEntry("key1", "REVOKED", "reason for key1"); + KeyRevocationList blocklist = new KeyRevocationList(); + blocklist.addEntry("key1", "REVOKED", "reason for key1"); KeyRevocationList.RevocationStatus revocationStatus = - blacklist.getRevocationStatusForKey("key1"); + blocklist.getRevocationStatusForKey("key1"); Assert.assertNotNull(revocationStatus); Assert.assertEquals(revocationStatus.mReason, "reason for key1"); - revocationStatus = blacklist.getRevocationStatusForKey("key2"); + revocationStatus = blocklist.getRevocationStatusForKey("key2"); Assert.assertNull(revocationStatus); - Assert.assertTrue(blacklist.isRevoked("key1")); - Assert.assertFalse(blacklist.isRevoked("key2")); + Assert.assertTrue(blocklist.isRevoked("key1")); + Assert.assertFalse(blocklist.isRevoked("key2")); } }