mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 16:14:10 -08:00
Fix running tests in Windows
This commit is contained in:
parent
c9d97b7144
commit
19c0492c33
|
@ -228,8 +228,8 @@ public class TeaVMTestRunner extends Runner implements Filterable {
|
|||
|
||||
private Process chromeBrowser(String url) {
|
||||
return browserTemplate("chrome", url, (profile, params) -> {
|
||||
addChromeCommand(params);
|
||||
params.addAll(Arrays.asList(
|
||||
"google-chrome-stable",
|
||||
"--headless",
|
||||
"--disable-gpu",
|
||||
"--remote-debugging-port=9222",
|
||||
|
@ -241,8 +241,8 @@ public class TeaVMTestRunner extends Runner implements Filterable {
|
|||
|
||||
private Process firefoxBrowser(String url) {
|
||||
return browserTemplate("firefox", url, (profile, params) -> {
|
||||
addFirefoxCommand(params);
|
||||
params.addAll(Arrays.asList(
|
||||
"firefox",
|
||||
"--headless",
|
||||
"--profile",
|
||||
profile
|
||||
|
@ -250,6 +250,30 @@ public class TeaVMTestRunner extends Runner implements Filterable {
|
|||
});
|
||||
}
|
||||
|
||||
private void addChromeCommand(List<String> params) {
|
||||
if (isWindows()) {
|
||||
params.add("cmd.exe");
|
||||
params.add("start");
|
||||
params.add("/C");
|
||||
params.add("chrome");
|
||||
} else {
|
||||
params.add("google-chrome-stable");
|
||||
}
|
||||
}
|
||||
|
||||
private void addFirefoxCommand(List<String> params) {
|
||||
if (isWindows()) {
|
||||
params.add("cmd.exe");
|
||||
params.add("/C");
|
||||
params.add("start");
|
||||
}
|
||||
params.add("firefox");
|
||||
}
|
||||
|
||||
private boolean isWindows() {
|
||||
return System.getProperty("os.name").toLowerCase().startsWith("windows");
|
||||
}
|
||||
|
||||
private Process browserTemplate(String name, String url, BiConsumer<String, List<String>> paramsBuilder) {
|
||||
File temp;
|
||||
try {
|
||||
|
|
Loading…
Reference in New Issue
Block a user