Skip to content

Commit 9114480

Browse files
committed
Add "additionalCommands" support to DriverCommandExecutor.
Keeping it protected as there's no existing use case for wider visibility. Note that I opted for the more standard order of parameters (for the overloaded methods of this sort) over that unfortunate non-standard ordering that HttpCommandExecutor uses for some reason.
1 parent b0fbed0 commit 9114480

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

java/client/src/org/openqa/selenium/remote/HttpCommandExecutor.java

+4
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ public HttpCommandExecutor(URL addressOfRemoteServer) {
5858
this(ImmutableMap.<String, CommandInfo>of(), addressOfRemoteServer);
5959
}
6060

61+
/**
62+
* Creates an {@link HttpCommandExecutor} that supports non-standard
63+
* {@code additionalCommands} in addition to the standard.
64+
*/
6165
public HttpCommandExecutor(
6266
Map<String, CommandInfo> additionalCommands, URL addressOfRemoteServer) {
6367
this(additionalCommands, addressOfRemoteServer, getDefaultClientFactory());

java/client/src/org/openqa/selenium/remote/service/DriverCommandExecutor.java

+12
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@
2121

2222
import org.openqa.selenium.WebDriverException;
2323
import org.openqa.selenium.remote.Command;
24+
import org.openqa.selenium.remote.CommandInfo;
2425
import org.openqa.selenium.remote.DriverCommand;
2526
import org.openqa.selenium.remote.HttpCommandExecutor;
2627
import org.openqa.selenium.remote.Response;
2728

2829
import java.io.IOException;
2930
import java.net.ConnectException;
31+
import java.util.Map;
3032

3133
/**
3234
* A specialized {@link HttpCommandExecutor} that will use a {@link DriverService} that lives
@@ -48,6 +50,16 @@ public DriverCommandExecutor(DriverService service) {
4850
this.service = service;
4951
}
5052

53+
/**
54+
* Creates an {@link DriverCommandExecutor} that supports non-standard
55+
* {@code additionalCommands} in addition to the standard.
56+
*/
57+
protected DriverCommandExecutor(
58+
DriverService service, Map<String, CommandInfo> additionalCommands) {
59+
super(additionalCommands, service.getUrl());
60+
this.service = service;
61+
}
62+
5163
/**
5264
* Sends the {@code command} to the driver server for execution. The server will be started
5365
* if requesting a new session. Likewise, if terminating a session, the server will be shutdown

0 commit comments

Comments
 (0)