| Index: java/client/test/org/openqa/selenium/testing/drivers/TestChromeDriver.java |
| =================================================================== |
| --- java/client/test/org/openqa/selenium/testing/drivers/TestChromeDriver.java (revision 17049) |
| +++ java/client/test/org/openqa/selenium/testing/drivers/TestChromeDriver.java (working copy) |
| @@ -74,6 +74,10 @@ |
| if (chromePath != null) { |
| options.setBinary(new File(chromePath)); |
| } |
| + String androidPackage = System.getProperty("webdriver.chrome.android_package"); |
| + if (androidPackage != null) { |
| + options.setAndroidPackage(androidPackage); |
| + } |
| |
| DesiredCapabilities capabilities = DesiredCapabilities.chrome(); |
| capabilities.setCapability(ChromeOptions.CAPABILITY, options); |
| Index: java/client/src/org/openqa/selenium/chrome/ChromeOptions.java |
| =================================================================== |
| --- java/client/src/org/openqa/selenium/chrome/ChromeOptions.java (revision 17049) |
| +++ java/client/src/org/openqa/selenium/chrome/ChromeOptions.java (working copy) |
| @@ -65,6 +65,7 @@ |
| public static final String CAPABILITY = "chromeOptions"; |
| |
| private File binary; |
| + private String androidPackage; |
| private List<String> args = Lists.newArrayList(); |
| private List<File> extensionFiles = Lists.newArrayList(); |
| private Map<String, Object> experimentalOptions = Maps.newHashMap(); |
| @@ -81,6 +82,16 @@ |
| } |
| |
| /** |
| + * Sets the Android package name for Chrome. The package should already exist |
| + * on the Android device. |
| + * |
| + * @param package_name Name of Chrome's Android package. |
| + */ |
| + public void setAndroidPackage(String package_name) { |
| + androidPackage = checkNotNull(package_name); |
| + } |
| + |
| + /** |
| * @param arguments The arguments to use when starting Chrome. |
| * @see #addArguments(java.util.List) |
| */ |
| @@ -147,6 +158,10 @@ |
| options.put("binary", binary.getPath()); |
| } |
| |
| + if (androidPackage != null) { |
| + options.put("android_package", androidPackage); |
| + } |
| + |
| options.put("args", ImmutableList.copyOf(args)); |
| |
| List<String> extensions = Lists.newArrayListWithExpectedSize( |