Add CTS that verifies the NotoColorEmoji is included
Bug: 194236700
Test: atest FontManagerTest
Change-Id: I2ccf002c0c4dd26b69a883c142a9a69bc3ad1902
diff --git a/tests/tests/graphics/src/android/graphics/fonts/FontManagerTest.java b/tests/tests/graphics/src/android/graphics/fonts/FontManagerTest.java
index dd9576f..b5c2d49 100644
--- a/tests/tests/graphics/src/android/graphics/fonts/FontManagerTest.java
+++ b/tests/tests/graphics/src/android/graphics/fonts/FontManagerTest.java
@@ -20,6 +20,7 @@
import static android.graphics.fonts.FontStyle.FONT_WEIGHT_NORMAL;
import static com.google.common.truth.Truth.assertThat;
+import static com.google.common.truth.Truth.assertWithMessage;
import static org.junit.Assert.fail;
@@ -269,5 +270,27 @@
}
}
+ @Test
+ public void fontManager_NotoColorEmojiAvailable() throws IOException {
+ FontConfig fontConfig = getFontConfig();
+ boolean hasNotoColorEmoji = false;
+
+ for (FontConfig.FontFamily family : fontConfig.getFontFamilies()) {
+
+ if (family.getLocaleList().size() == 1
+ && "Zsye".equals(family.getLocaleList().get(0).getScript())) {
+ if ("NotoColorEmoji".equals(family.getFontList().get(0).getPostScriptName())) {
+ hasNotoColorEmoji = true;
+ }
+ }
+ }
+
+ assertWithMessage("NotoColorEmoji must be included."
+ + "If you include your own font, place your emoji just before the "
+ + "NotoColorEmoji.ttf")
+ .that(hasNotoColorEmoji)
+ .isTrue();
+ }
+
// TODO: Add more tests once we sign test fonts.
}