Skip to content

Commit

Permalink
Merge pull request #1256 from luizvaz/patch-1
Browse files Browse the repository at this point in the history
Update DriverOptions.java
  • Loading branch information
ptrthomas authored Aug 17, 2020
2 parents 6dc6d28 + 9a5fd37 commit f2222b3
Showing 1 changed file with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ public class DriverOptions {
public final Logger driverLogger;
public final String uniqueName;
public final File workingDir;
public final boolean disableNotifications;
public final String userAgent;
public final String userDataDir;
public final String processLogFile;
public final int maxPayloadSize;
Expand Down Expand Up @@ -167,12 +169,20 @@ public DriverOptions(ScenarioContext context, Map<String, Object> options, LogAp
args.add(executable);
}
}
workingDir = new File(FileUtils.getBuildDir() + File.separator + uniqueName);
if (options.containsKey("userDataDir")) { // special case allow user-specified null
userDataDir = (String) options.get("userDataDir");
disableNotifications = get("disableNotifications", false);
userAgent = get("userAgent", null);
String place = get("userDataDir", null);
if (place != null) { // special case allow user-specified null
if (place.startsWith(".")){
workingDir = new File((new File(place)).getAbsolutePath());
} else{
workingDir = new File(place);
}
userDataDir = workingDir.getAbsolutePath();
} else {
workingDir = new File(FileUtils.getBuildDir() + File.separator + uniqueName);
userDataDir = workingDir.getAbsolutePath();
}
}
processLogFile = workingDir.getPath() + File.separator + type + ".log";
maxPayloadSize = get("maxPayloadSize", 4194304);
target = get("target", null);
Expand Down

0 comments on commit f2222b3

Please sign in to comment.