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

Commit c471c53e authored by Lee Shombert's avatar Lee Shombert
Browse files

Fix the testDumpOutput presubmit test

testDumpOutput depends on native timers, which are supported, if not
used in all phones.  However, native timers are not supported at all
on x86/MS-Windows test beds.  So, the test now silently returns if
native timers are not supported.

Test: atest
 * FrameworksServicesTests:AnrTimerTest

Bug: 326043049
Change-Id: Ic53db43fbaf826a6c9b925c4396010b7e267b6a0
parent be0aeae3
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -767,7 +767,7 @@ public class AnrTimer<V> implements AutoCloseable {
     * Return true if the native timers are supported.  Native timers are supported if the method
     * Return true if the native timers are supported.  Native timers are supported if the method
     * nativeAnrTimerSupported() can be executed and it returns true.
     * nativeAnrTimerSupported() can be executed and it returns true.
     */
     */
    private static boolean nativeTimersSupported() {
    public static boolean nativeTimersSupported() {
        try {
        try {
            return nativeAnrTimerSupported();
            return nativeAnrTimerSupported();
        } catch (java.lang.UnsatisfiedLinkError e) {
        } catch (java.lang.UnsatisfiedLinkError e) {
+3 −1
Original line number Original line Diff line number Diff line
@@ -312,10 +312,12 @@ public class AnrTimerTest {
    }
    }


    /**
    /**
     * Verify the dump output.
     * Verify the dump output.  This only applies when native timers are supported.
     */
     */
    @Test
    @Test
    public void testDumpOutput() throws Exception {
    public void testDumpOutput() throws Exception {
        if (!AnrTimer.nativeTimersSupported()) return;

        String r1 = getDumpOutput();
        String r1 = getDumpOutput();
        assertThat(r1).doesNotContain("timer:");
        assertThat(r1).doesNotContain("timer:");