@Override protected void startClient() { LazyCommandExecutor exe = (LazyCommandExecutor) getCommandExecutor(); FirefoxProfile profileToUse = getProfile(exe.profile); // TODO(simon): Make this not sinfully ugly ExtensionConnection connection = connectTo(exe.binary, profileToUse, "localhost"); exe.setConnection(connection); try { connection.start(); } catch (IOException e) { throw new WebDriverException("An error occurred while connecting to Firefox", e); } }
public void quit() { if (connection != null) { connection.quit(); connection = null; } if (profile != null) { profile.cleanTemporaryModel(); } }
public Response execute(Command command) throws IOException { if (connection == null) { if (command.getName().equals(DriverCommand.QUIT)) { return new Response(); } throw new SessionNotFoundException( "The FirefoxDriver cannot be used after quit() was called."); } return connection.execute(command); }
public URI getAddressOfRemoteServer() { return connection.getAddressOfRemoteServer(); }
public void setLocalLogs(LocalLogs logs) { this.logs = logs; if (connection != null) { connection.setLocalLogs(logs); } }
public void setConnection(ExtensionConnection connection) { this.connection = connection; connection.setLocalLogs(logs); }