diff options
author | Steven Laver <lavers@google.com> | 2019-11-05 13:42:59 -0800 |
---|---|---|
committer | Steven Laver <lavers@google.com> | 2019-11-09 01:16:30 +0000 |
commit | 7c6cc72e18cc1df5205fd2bc47664e6cc2534ad2 (patch) | |
tree | fc34e4ad6037cf231cccc3b56ccd13e82917520a /tests/BootImageProfileTest/src/com/android/bootimageprofile/BootImageProfileTest.java | |
parent | 8f4f93bf3ba75d8e83cb0a8618cb80f226ada5ac (diff) | |
parent | da5e1bd24a9a0ca24e7e49fad9e604409e573376 (diff) |
Merge RP1A.191024.001
Change-Id: I5cda3bba276e99d948b752be87d4599e9f882e0f
Diffstat (limited to 'tests/BootImageProfileTest/src/com/android/bootimageprofile/BootImageProfileTest.java')
-rw-r--r-- | tests/BootImageProfileTest/src/com/android/bootimageprofile/BootImageProfileTest.java | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/tests/BootImageProfileTest/src/com/android/bootimageprofile/BootImageProfileTest.java b/tests/BootImageProfileTest/src/com/android/bootimageprofile/BootImageProfileTest.java index 17986a3c9d61..ccdd452b3f1e 100644 --- a/tests/BootImageProfileTest/src/com/android/bootimageprofile/BootImageProfileTest.java +++ b/tests/BootImageProfileTest/src/com/android/bootimageprofile/BootImageProfileTest.java @@ -46,9 +46,11 @@ public class BootImageProfileTest implements IDeviceTest { */ @Test public void testProperties() throws Exception { - String res = mTestDevice.getProperty("dalvik.vm.profilebootclasspath"); + String res = mTestDevice.getProperty( + "persist.device_config.runtime_native_boot.profilebootclasspath"); assertTrue("profile boot class path not enabled", res != null && res.equals("true")); - res = mTestDevice.getProperty("dalvik.vm.profilesystemserver"); + res = mTestDevice.getProperty( + "persist.device_config.runtime_native_boot.profilesystemserver"); assertTrue("profile system server not enabled", res != null && res.equals("true")); } @@ -66,10 +68,18 @@ public class BootImageProfileTest implements IDeviceTest { String res; res = mTestDevice.executeShellCommand("truncate -s 0 " + SYSTEM_SERVER_PROFILE).trim(); assertTrue(res, res.length() == 0); - // Force save profiles in case the system just started. + // Wait up to 20 seconds for the profile to be saved. + for (int i = 0; i < 20; ++i) { + // Force save the profile since we truncated it. + forceSaveProfile("system_server"); + String s = mTestDevice.executeShellCommand("wc -c <" + SYSTEM_SERVER_PROFILE).trim(); + if (!"0".equals(s)) { + break; + } + Thread.sleep(1000); + } + // In case the profile is partially saved, wait an extra second. Thread.sleep(1000); - forceSaveProfile("system_server"); - Thread.sleep(2000); // Validate that the profile is non empty. res = mTestDevice.executeShellCommand("profman --dump-only --profile-file=" + SYSTEM_SERVER_PROFILE); @@ -84,5 +94,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;-><init>()V")) { + sawObjectInit = true; + } + } + assertTrue("Did not see Object.<init> in " + res, sawObjectInit); } } |