Skip to content

Commit

Permalink
[java] Respecting "webdriver.firefox.logfile" system property in lega…
Browse files Browse the repository at this point in the history
…cy Firefox driver. Fixes #6649
  • Loading branch information
barancev committed Apr 13, 2019
1 parent 5945b07 commit f78cbf9
Showing 1 changed file with 1 addition and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,8 @@
import org.openqa.selenium.remote.service.DriverService;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
Expand Down Expand Up @@ -154,7 +152,7 @@ public void start() throws IOException {
process.updateDynamicLibraryPath(firefoxLibraryPath);
}

process.copyOutputTo(getActualOutputStream());
process.copyOutputTo(getOutputStream());

process.executeAsync();

Expand Down Expand Up @@ -226,17 +224,6 @@ private String extractAndCheck(File profileDir, String noFocusSoName,
return builtPath.toString();
}

private OutputStream getActualOutputStream() throws FileNotFoundException {
String firefoxLogFile = System.getProperty(FirefoxDriver.SystemProperty.BROWSER_LOGFILE);
if (firefoxLogFile != null) {
if ("/dev/stdout".equals(firefoxLogFile)) {
return System.out;
}
return new FileOutputStream(firefoxLogFile);
}
return getOutputStream();
}

@Override
protected void waitUntilAvailable() throws MalformedURLException {
try {
Expand Down

0 comments on commit f78cbf9

Please sign in to comment.