Package com.google.jstestdriver

Examples of com.google.jstestdriver.SlaveBrowser.createCommand()


    SlaveBrowser slave =
        new SlaveBrowser(new TimeImpl(), id, new BrowserInfo(), 20, null, CaptureHandler.QUIRKS,
            RunnerType.CLIENT, BrowserState.CAPTURED, new Instant(0));
    String data = "hello";

    slave.createCommand(data);
    browsers.addSlave(slave);
    BrowserQueryResponseHandler handler =
        new BrowserQueryResponseHandler(null, null, browsers, streamedResponses);

    handler.service(id, null, "true", null, writer);
View Full Code Here


            RunnerType.CLIENT, BrowserState.CAPTURED, new Instant(0));

    browsers.addSlave(slave);
    BrowserQueryResponseHandler handler =
        new BrowserQueryResponseHandler(null, null, browsers, streamedResponses);
    slave.createCommand("awaitingResponse");
    slave.dequeueCommand();
    slave.createCommand("BrowserCommand");
    Gson gson = new Gson();
    Response response = new Response();
View Full Code Here

    browsers.addSlave(slave);
    BrowserQueryResponseHandler handler =
        new BrowserQueryResponseHandler(null, null, browsers, streamedResponses);
    slave.createCommand("awaitingResponse");
    slave.dequeueCommand();
    slave.createCommand("BrowserCommand");
    Gson gson = new Gson();
    Response response = new Response();

    response.setResponse("response");
    BrowserInfo browserInfo = new BrowserInfo();
View Full Code Here

    SlaveBrowser slave =
        new SlaveBrowser(time, id, new BrowserInfo(), 20, null, CaptureHandler.QUIRKS,
            RunnerType.CLIENT, BrowserState.CAPTURED, new Instant(0));
    String data = "hello";

    slave.createCommand(data);
    browsers.addSlave(slave);
    BrowserQueryResponseHandler handler =
        new BrowserQueryResponseHandler(null, null, browsers, streamedResponses);

    handler.service(id, null, null, null, writer);
View Full Code Here

            RunnerType.CLIENT, BrowserState.CAPTURED, new Instant(0));

    browsers.addSlave(slave);
    BrowserQueryResponseHandler handler =
        new BrowserQueryResponseHandler(null, null, browsers, streamedResponses);
    slave.createCommand("awaitingResponse");
    slave.dequeueCommand();
    slave.createCommand("BrowserCommand");
    Gson gson = new Gson();
    Response response = new Response();
View Full Code Here

    browsers.addSlave(slave);
    BrowserQueryResponseHandler handler =
        new BrowserQueryResponseHandler(null, null, browsers, streamedResponses);
    slave.createCommand("awaitingResponse");
    slave.dequeueCommand();
    slave.createCommand("BrowserCommand");
    Gson gson = new Gson();
    Response response = new Response();

    response.setResponse("response");
    BrowserInfo browserInfo = new BrowserInfo();
View Full Code Here

    List<FileResult> fileResults = new LinkedList<FileResult>();

    fileResults.add(new FileResult(new FileSource("/test/filename1.js", "filename1.js", 123, -1), true, ""));
    fileResults.add(new FileResult(new FileSource("/test/filename2.js", "filename2.js", 456, -1), true, ""));
    fileResults.add(new FileResult(new FileSource("/test/filename3.js", "filename3.js", 789, -1), true, ""));
    slave.createCommand("awaitingResponse");
    slave.dequeueCommand();
    slave.createCommand("BrowserCommand");
    Response response = new Response();

    response.setType(ResponseType.FILE_LOAD_RESULT.name());
View Full Code Here

    fileResults.add(new FileResult(new FileSource("/test/filename1.js", "filename1.js", 123, -1), true, ""));
    fileResults.add(new FileResult(new FileSource("/test/filename2.js", "filename2.js", 456, -1), true, ""));
    fileResults.add(new FileResult(new FileSource("/test/filename3.js", "filename3.js", 789, -1), true, ""));
    slave.createCommand("awaitingResponse");
    slave.dequeueCommand();
    slave.createCommand("BrowserCommand");
    Response response = new Response();

    response.setType(ResponseType.FILE_LOAD_RESULT.name());
    response.setResponse(gson.toJson(new LoadedFiles(fileResults)));
    handler.service("1", gson.toJson(response), "", null, writer);
View Full Code Here

    response.setType(ResponseType.RESET_RESULT.name());
    response.setResponse(new Gson().toJson(new LoadedFiles()));
    response.setBrowser(new BrowserInfo());

    JsonCommand resetCommand = new JsonCommand(CommandType.RESET, Collections.<String>emptyList());
    slave.createCommand(gson.toJson(resetCommand));
    slave.dequeueCommand();

    handler.service(id, gson.toJson(response), "", null, writer);

    Set<FileInfo> fileInfos = slave.getFileSet();
View Full Code Here

  public void service(String id, String data) {
    SlaveBrowser browser = capturedBrowsers.getBrowser(id);

    data = translateUrls(data);
    logger.trace("Adding command to browser queue: {}", data);
    browser.createCommand(data);
  }

  // TODO(corysmith): figure out what this does.
  private String translateUrls(String data) {
    JsonCommand command = gson.fromJson(data, JsonCommand.class);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.