public class NewProfileExtensionConnection extends java.lang.Object implements ExtensionConnection, NeedsLocalLogs
| Modifier and Type | Field and Description |
|---|---|
private static int |
BUFFER_SIZE |
private long |
connectTimeout |
private HttpCommandExecutor |
delegate |
private java.lang.String |
host |
private org.openqa.selenium.internal.Lock |
lock |
private LocalLogs |
logs |
private static NetworkUtils |
networkUtils |
private FirefoxBinary |
process |
private FirefoxProfile |
profile |
private java.io.File |
profileDir |
| Constructor and Description |
|---|
NewProfileExtensionConnection(org.openqa.selenium.internal.Lock lock,
FirefoxBinary binary,
FirefoxProfile profile,
java.lang.String host) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addWebDriverExtensionIfNeeded() |
private static java.net.URL |
buildUrl(java.lang.String host,
int port)
Builds the URL for the Firefox extension running on the given host and port.
|
protected int |
determineNextFreePort(int port) |
Response |
execute(Command command) |
java.net.URI |
getAddressOfRemoteServer() |
boolean |
isConnected() |
private static com.google.common.base.Optional<Extension> |
loadCustomExtension() |
private static Extension |
loadDefaultExtension() |
void |
quit()
Terminates the connection.
|
void |
setLocalLogs(LocalLogs logs) |
void |
start()
Establishes a connection to the extension.
|
private static final int BUFFER_SIZE
private static final NetworkUtils networkUtils
private final long connectTimeout
private final FirefoxBinary process
private final FirefoxProfile profile
private final java.lang.String host
private final org.openqa.selenium.internal.Lock lock
private java.io.File profileDir
private HttpCommandExecutor delegate
private LocalLogs logs
public NewProfileExtensionConnection(org.openqa.selenium.internal.Lock lock,
FirefoxBinary binary,
FirefoxProfile profile,
java.lang.String host)
throws java.lang.Exception
java.lang.Exceptionpublic void start()
throws java.io.IOException
ExtensionConnectionstart in interface ExtensionConnectionjava.io.IOException - If an I/O error occurs.protected void addWebDriverExtensionIfNeeded()
private static com.google.common.base.Optional<Extension> loadCustomExtension()
private static Extension loadDefaultExtension()
public Response execute(Command command) throws java.io.IOException
execute in interface CommandExecutorjava.io.IOExceptionprotected int determineNextFreePort(int port)
public void quit()
ExtensionConnectionquit in interface ExtensionConnectionprivate static java.net.URL buildUrl(java.lang.String host,
int port)
localhost, an attempt will be made to find the correct loopback address.host - The hostname the extension is running on.port - The port the extension is listening on.public boolean isConnected()
isConnected in interface ExtensionConnectionpublic void setLocalLogs(LocalLogs logs)
setLocalLogs in interface NeedsLocalLogspublic java.net.URI getAddressOfRemoteServer()
getAddressOfRemoteServer in interface ExtensionConnection