diff --git a/tools/junit/src/main/java/org/teavm/junit/TeaVMTestRunner.java b/tools/junit/src/main/java/org/teavm/junit/TeaVMTestRunner.java index 728e21370..ef991547a 100644 --- a/tools/junit/src/main/java/org/teavm/junit/TeaVMTestRunner.java +++ b/tools/junit/src/main/java/org/teavm/junit/TeaVMTestRunner.java @@ -250,7 +250,9 @@ public class TeaVMTestRunner extends Runner implements Filterable { } private void addChromeCommand(List params) { - if (isWindows()) { + if (isMacos()) { + params.add("/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"); + } else if (isWindows()) { params.add("cmd.exe"); params.add("start"); params.add("/C"); @@ -261,6 +263,10 @@ public class TeaVMTestRunner extends Runner implements Filterable { } private void addFirefoxCommand(List params) { + if (isMacos()) { + params.add("/Applications/Firefox.app/Contents/MacOS/firefox"); + return; + } if (isWindows()) { params.add("cmd.exe"); params.add("/C"); @@ -273,6 +279,10 @@ public class TeaVMTestRunner extends Runner implements Filterable { return System.getProperty("os.name").toLowerCase().startsWith("windows"); } + private boolean isMacos() { + return System.getProperty("os.name").toLowerCase().startsWith("mac"); + } + private Process browserTemplate(String name, String url, BiConsumer> paramsBuilder) { File temp; try {