| Index: patch.diff
|
| ===================================================================
|
| --- patch.diff (revision 173943)
|
| +++ patch.diff (working copy)
|
| @@ -1,6 +1,6 @@
|
| Index: java/client/test/org/openqa/selenium/testing/drivers/ReflectionBackedDriverSupplier.java
|
| ===================================================================
|
| ---- java/client/test/org/openqa/selenium/testing/drivers/ReflectionBackedDriverSupplier.java (revision 17049)
|
| +--- java/client/test/org/openqa/selenium/testing/drivers/ReflectionBackedDriverSupplier.java (revision 18370)
|
| +++ java/client/test/org/openqa/selenium/testing/drivers/ReflectionBackedDriverSupplier.java (working copy)
|
| @@ -87,7 +87,7 @@
|
| if (DesiredCapabilities.android().getBrowserName().equals(name)) {
|
| @@ -13,7 +13,7 @@
|
| } else if (DesiredCapabilities.htmlUnit().getBrowserName().equals(name)) {
|
| Index: java/client/test/org/openqa/selenium/testing/drivers/build.desc
|
| ===================================================================
|
| ---- java/client/test/org/openqa/selenium/testing/drivers/build.desc (revision 17049)
|
| +--- java/client/test/org/openqa/selenium/testing/drivers/build.desc (revision 18370)
|
| +++ java/client/test/org/openqa/selenium/testing/drivers/build.desc (working copy)
|
| @@ -9,6 +9,7 @@
|
| "SauceDriver.java",
|
| @@ -84,12 +84,11 @@
|
| + return capabilities;
|
| + }
|
| +}
|
| -\ No newline at end of file
|
| Index: java/client/src/org/openqa/selenium/chrome/NewCommandExecutor.java
|
| ===================================================================
|
| --- java/client/src/org/openqa/selenium/chrome/NewCommandExecutor.java (revision 0)
|
| +++ java/client/src/org/openqa/selenium/chrome/NewCommandExecutor.java (revision 0)
|
| -@@ -0,0 +1,54 @@
|
| +@@ -0,0 +1,53 @@
|
| +/*
|
| +Copyright 2012 Selenium committers
|
| +Copyright 2012 Software Freedom Conservancy
|
| @@ -109,8 +108,6 @@
|
| +
|
| +package org.openqa.selenium.chrome;
|
| +
|
| -+import org.json.JSONException;
|
| -+import org.json.JSONObject;
|
| +import org.openqa.selenium.remote.BeanToJsonConverter;
|
| +import org.openqa.selenium.remote.Command;
|
| +import org.openqa.selenium.remote.CommandExecutor;
|
| @@ -118,28 +115,29 @@
|
| +import org.openqa.selenium.remote.Response;
|
| +
|
| +import java.io.IOException;
|
| ++import java.util.HashMap;
|
| ++import java.util.Map;
|
| +
|
| +/**
|
| + * Executes a ChromeDriver command using the new ChromeDriver.
|
| + */
|
| +public class NewCommandExecutor implements CommandExecutor {
|
| +
|
| ++ static {
|
| ++ System.loadLibrary("chromedriver");
|
| ++ }
|
| ++
|
| + @Override
|
| + public Response execute(Command command) throws IOException {
|
| -+ System.loadLibrary("chromedriver");
|
| -+ JSONObject jsonCommand = new JSONObject();
|
| -+ try {
|
| -+ jsonCommand.put("name", command.getName());
|
| -+ jsonCommand.put("parameters", command.getParameters());
|
| -+ String id = "";
|
| -+ if (command.getSessionId() != null)
|
| -+ id = command.getSessionId().toString();
|
| -+ jsonCommand.put("sessionId", id);
|
| -+ String responseText = execute(new BeanToJsonConverter().convert(jsonCommand));
|
| -+ return new JsonToBeanConverter().convert(Response.class, responseText);
|
| -+ } catch (JSONException e) {
|
| -+ throw new IOException(e);
|
| -+ }
|
| ++ Map<String, Object> jsonCommand = new HashMap<String, Object>();
|
| ++ jsonCommand.put("name", command.getName());
|
| ++ jsonCommand.put("parameters", command.getParameters());
|
| ++ String id = "";
|
| ++ if (command.getSessionId() != null)
|
| ++ id = command.getSessionId().toString();
|
| ++ jsonCommand.put("sessionId", id);
|
| ++ String responseText = execute(new BeanToJsonConverter().convert(jsonCommand));
|
| ++ return new JsonToBeanConverter().convert(Response.class, responseText);
|
| + }
|
| +
|
| + private static native String execute(String command);
|
|
|