From f34532e53a8797fb34c9925104c6241985acbc2c Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Mon, 4 Nov 2019 13:53:35 -0800 Subject: Add test for system server method sampling Verify that the package manager constructor is in the profile. Bug: 139883463 Test: atest BootImageProfileTest Change-Id: I53350be972771c246c95f623eeb1289c59c9ba84 --- .../src/com/android/bootimageprofile/BootImageProfileTest.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tests/BootImageProfileTest/src') diff --git a/tests/BootImageProfileTest/src/com/android/bootimageprofile/BootImageProfileTest.java b/tests/BootImageProfileTest/src/com/android/bootimageprofile/BootImageProfileTest.java index 81937e6b7005..f8e338e93002 100644 --- a/tests/BootImageProfileTest/src/com/android/bootimageprofile/BootImageProfileTest.java +++ b/tests/BootImageProfileTest/src/com/android/bootimageprofile/BootImageProfileTest.java @@ -106,13 +106,18 @@ public class BootImageProfileTest implements IDeviceTest { // Test the profile contents contain common methods for core-oj that would normally be AOT // compiled. res = mTestDevice.executeShellCommand("profman --dump-classes-and-methods --profile-file=" - + SYSTEM_SERVER_PROFILE + " --apk=/apex/com.android.art/javalib/core-oj.jar"); + + SYSTEM_SERVER_PROFILE + " --apk=/apex/com.android.art/javalib/core-oj.jar" + + " --apk=/system/framework/services.jar"); boolean sawObjectInit = false; + boolean sawPmInit = false; for (String line : res.split("\n")) { if (line.contains("Ljava/lang/Object;->()V")) { sawObjectInit = true; + } else if (line.contains("Lcom/android/server/pm/PackageManagerService;->")) { + sawPmInit = true; } } assertTrue("Did not see Object. in " + res, sawObjectInit); + assertTrue("Did not see PackageManagerService. in " + res, sawPmInit); } } -- cgit v1.2.3-59-g8ed1b