From bafd39c1cb3ffc4210bf98baec9f61dfbbaa7ca8 Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Mon, 30 Sep 2019 17:05:06 -0700 Subject: Add a test that we get samples for a common core-oj method Test: atest frameworks/base/tests/BootImageProfileTest/src/com/android/bootimageprofile/BootImageProfileTest.java Bug: 139883463 Change-Id: I11d0d98731756da5b9739b18acb5ab140657ca34 --- .../com/android/bootimageprofile/BootImageProfileTest.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tests/BootImageProfileTest') diff --git a/tests/BootImageProfileTest/src/com/android/bootimageprofile/BootImageProfileTest.java b/tests/BootImageProfileTest/src/com/android/bootimageprofile/BootImageProfileTest.java index 730b210f1529..fe1d9d26c7e7 100644 --- a/tests/BootImageProfileTest/src/com/android/bootimageprofile/BootImageProfileTest.java +++ b/tests/BootImageProfileTest/src/com/android/bootimageprofile/BootImageProfileTest.java @@ -92,5 +92,18 @@ public class BootImageProfileTest implements IDeviceTest { } assertTrue("Did not see framework.jar in " + res, sawFramework); assertTrue("Did not see services.jar in " + res, sawServices); + + + // 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"); + boolean sawObjectInit = false; + for (String line : res.split("\n")) { + if (line.contains("Ljava/lang/Object;->()V")) { + sawObjectInit = true; + } + } + assertTrue("Did not see Object. in " + res, sawObjectInit); } } -- cgit v1.2.3-59-g8ed1b