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

Commit 4873823d authored by Matthew Reynolds's avatar Matthew Reynolds
Browse files

Changed isRoboletricTest() to check against VM.

The original isRobolectricTest() used Build.os.HARDWARE, but sometimes
the Robolectric environment isn't initialized, so we test against the
VM which is a bit more robust.

Bug: 346864770
Flag: TEST_ONLY
Test: tested manually with atest
Change-Id: Ie0c117210e899fe1ddb94f66dae551d44c768915
parent 8ed5bdf2
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -21,7 +21,6 @@ import static org.mockito.Mockito.when;
import android.app.Instrumentation;
import android.content.Context;
import android.content.res.Resources;
import android.os.Build;
import android.os.Handler;
import android.os.HandlerExecutor;
import android.os.Looper;
@@ -297,7 +296,7 @@ public abstract class SysuiTestCase {
    }

    public static boolean isRobolectricTest() {
        return !isRavenwoodTest() && Build.FINGERPRINT.contains("robolectric");
        return !isRavenwoodTest() && !System.getProperty("java.vm.name").equals("Dalvik");
    }

    protected boolean isScreenshotTest() {