Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bafd39c1 authored by Mathieu Chartier's avatar Mathieu Chartier
Browse files

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
parent 25f4dca6
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -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;-><init>()V")) {
                sawObjectInit = true;
            }
        }
        assertTrue("Did not see Object.<init> in " + res, sawObjectInit);
    }
}