From f74e3b69d4b0283d29b32979369065d2296df0b9 Mon Sep 17 00:00:00 2001 From: Kohsuke Yatoh Date: Sat, 1 May 2021 22:30:57 -0700 Subject: [PATCH] Make UpdatableSystemFontTest device side test. As commit 679a824773aee8c4424787e9f36d10de1f984112 removed 'adb shell stop', this test doesn't need to be a host side test. This allows us to call FontManager Java API in UpdatableSystemFontTest. I will rewrite 'cmd font' to FontManager API calls in a following CL. Bug: 186966067 Test: atest UpdatableSystemFontTest Change-Id: I3bad29a3ea8402c990ae0dd553d3230db2d9f67c --- tests/UpdatableSystemFontTest/Android.bp | 14 +- .../AndroidManifest.xml | 30 +++ tests/UpdatableSystemFontTest/AndroidTest.xml | 5 +- .../UpdatableSystemFontTest.java | 186 +++++++++++------- 4 files changed, 158 insertions(+), 77 deletions(-) create mode 100644 tests/UpdatableSystemFontTest/AndroidManifest.xml diff --git a/tests/UpdatableSystemFontTest/Android.bp b/tests/UpdatableSystemFontTest/Android.bp index 8b0ae5c37baed..ea5a43104bbaa 100644 --- a/tests/UpdatableSystemFontTest/Android.bp +++ b/tests/UpdatableSystemFontTest/Android.bp @@ -21,16 +21,15 @@ package { default_applicable_licenses: ["frameworks_base_license"], } -java_test_host { +android_test { name: "UpdatableSystemFontTest", srcs: ["src/**/*.java"], - libs: [ - "tradefed", - "compatibility-tradefed", - "compatibility-host-util", - ], + libs: ["android.test.runner"], static_libs: [ - "frameworks-base-hostutils", + "androidx.test.ext.junit", + "compatibility-device-util-axt", + "platform-test-annotations", + "truth-prebuilt", ], test_suites: [ "general-tests", @@ -47,4 +46,5 @@ java_test_host { ":UpdatableSystemFontTestNotoColorEmojiVPlus2Ttf", ":UpdatableSystemFontTestNotoColorEmojiVPlus2TtfFsvSig", ], + sdk_version: "test_current", } diff --git a/tests/UpdatableSystemFontTest/AndroidManifest.xml b/tests/UpdatableSystemFontTest/AndroidManifest.xml new file mode 100644 index 0000000000000..531ee981a92cc --- /dev/null +++ b/tests/UpdatableSystemFontTest/AndroidManifest.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + diff --git a/tests/UpdatableSystemFontTest/AndroidTest.xml b/tests/UpdatableSystemFontTest/AndroidTest.xml index 4f116698ba72b..4f6487e7e953a 100644 --- a/tests/UpdatableSystemFontTest/AndroidTest.xml +++ b/tests/UpdatableSystemFontTest/AndroidTest.xml @@ -21,6 +21,7 @@ @@ -37,7 +38,7 @@