Exemplo n.º 1
0
  @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);
    }
  }
Exemplo n.º 2
0
 public void quit() {
   if (connection != null) {
     connection.quit();
     connection = null;
   }
   if (profile != null) {
     profile.cleanTemporaryModel();
   }
 }
Exemplo n.º 3
0
 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);
 }
Exemplo n.º 4
0
 public URI getAddressOfRemoteServer() {
   return connection.getAddressOfRemoteServer();
 }
Exemplo n.º 5
0
 public void setLocalLogs(LocalLogs logs) {
   this.logs = logs;
   if (connection != null) {
     connection.setLocalLogs(logs);
   }
 }
Exemplo n.º 6
0
 public void setConnection(ExtensionConnection connection) {
   this.connection = connection;
   connection.setLocalLogs(logs);
 }