aboutsummaryrefslogtreecommitdiff
path: root/node_modules/selenium-webdriver/chrome.js
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2016-11-16 01:59:39 +0100
committerFlorian Dold <florian.dold@gmail.com>2016-11-16 02:00:31 +0100
commitbd65bb67e25a79b019d745b7262b2008ce2adb15 (patch)
tree89e1b032103a63737f1a703e6a943832ef261704 /node_modules/selenium-webdriver/chrome.js
parentf91466595b651721690133f58ab37f977539e95b (diff)
incrementally verify denoms
The denominations are not stored in a separate object store.
Diffstat (limited to 'node_modules/selenium-webdriver/chrome.js')
-rw-r--r--node_modules/selenium-webdriver/chrome.js47
1 files changed, 19 insertions, 28 deletions
diff --git a/node_modules/selenium-webdriver/chrome.js b/node_modules/selenium-webdriver/chrome.js
index 13d7b7bbf..eb33df9ed 100644
--- a/node_modules/selenium-webdriver/chrome.js
+++ b/node_modules/selenium-webdriver/chrome.js
@@ -119,8 +119,7 @@ const fs = require('fs'),
const http = require('./http'),
io = require('./io'),
- Capabilities = require('./lib/capabilities').Capabilities,
- Capability = require('./lib/capabilities').Capability,
+ {Capabilities, Capability} = require('./lib/capabilities'),
command = require('./lib/command'),
logging = require('./lib/logging'),
promise = require('./lib/promise'),
@@ -678,34 +677,27 @@ class Options {
* Creates a new WebDriver client for Chrome.
*/
class Driver extends webdriver.WebDriver {
+
/**
- * @param {(Capabilities|Options)=} opt_config The configuration
- * options.
- * @param {remote.DriverService=} opt_service The session to use; will use
- * the {@linkplain #getDefaultService default service} by default.
- * @param {promise.ControlFlow=} opt_flow The control flow to use,
- * or {@code null} to use the currently active flow.
- * @param {http.Executor=} opt_executor A pre-configured command executor that
- * should be used to send commands to the remote end. The provided
- * executor should not be reused with other clients as its internal
- * command mappings will be updated to support Chrome-specific commands.
- *
- * You may provide either a custom executor or a driver service, but not both.
+ * Creates a new session with the ChromeDriver.
*
- * @throws {Error} if both `opt_service` and `opt_executor` are provided.
+ * @param {(Capabilities|Options)=} opt_config The configuration options.
+ * @param {(remote.DriverService|http.Executor)=} opt_serviceExecutor Either
+ * a DriverService to use for the remote end, or a preconfigured executor
+ * for an externally managed endpoint. If neither is provided, the
+ * {@linkplain ##getDefaultService default service} will be used by
+ * default.
+ * @param {promise.ControlFlow=} opt_flow The control flow to use, or `null`
+ * to use the currently active flow.
+ * @return {!Driver} A new driver instance.
*/
- constructor(opt_config, opt_service, opt_flow, opt_executor) {
- if (opt_service && opt_executor) {
- throw Error(
- 'Either a DriverService or Executor may be provided, but not both');
- }
-
+ static createSession(opt_config, opt_serviceExecutor, opt_flow) {
let executor;
- if (opt_executor) {
- executor = opt_executor;
+ if (opt_serviceExecutor instanceof http.Executor) {
+ executor = opt_serviceExecutor;
configureExecutor(executor);
} else {
- let service = opt_service || getDefaultService();
+ let service = opt_serviceExecutor || getDefaultService();
executor = createExecutor(service.start());
}
@@ -713,9 +705,8 @@ class Driver extends webdriver.WebDriver {
opt_config instanceof Options ? opt_config.toCapabilities() :
(opt_config || Capabilities.chrome());
- let driver = webdriver.WebDriver.createSession(executor, caps, opt_flow);
-
- super(driver.getSession(), executor, driver.controlFlow());
+ return /** @type {!Driver} */(
+ webdriver.WebDriver.createSession(executor, caps, opt_flow, this));
}
/**
@@ -728,7 +719,7 @@ class Driver extends webdriver.WebDriver {
/**
* Schedules a command to launch Chrome App with given ID.
* @param {string} id ID of the App to launch.
- * @return {!promise.Promise<void>} A promise that will be resolved
+ * @return {!promise.Thenable<void>} A promise that will be resolved
* when app is launched.
*/
launchApp(id) {