diff options
Diffstat (limited to 'node_modules/selenium-webdriver/lib/test/httpserver.js')
-rw-r--r-- | node_modules/selenium-webdriver/lib/test/httpserver.js | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/node_modules/selenium-webdriver/lib/test/httpserver.js b/node_modules/selenium-webdriver/lib/test/httpserver.js index 55b12551f..f7847f734 100644 --- a/node_modules/selenium-webdriver/lib/test/httpserver.js +++ b/node_modules/selenium-webdriver/lib/test/httpserver.js @@ -50,14 +50,14 @@ var Server = function(requestHandler) { * Starts the server on the given port. If no port, or 0, is provided, * the server will be started on a random port. * @param {number=} opt_port The port to start on. - * @return {!webdriver.promise.Promise.<Host>} A promise that will resolve + * @return {!Promise<Host>} A promise that will resolve * with the server host when it has fully started. */ this.start = function(opt_port) { assert(typeof opt_port !== 'function', "start invoked with function, not port (mocha callback)?"); var port = opt_port || portprober.findFreePort('localhost'); - return promise.when(port, function(port) { + return Promise.resolve(port).then(port => { return promise.checkedNodeCall( server.listen.bind(server, port, 'localhost')); }).then(function() { @@ -67,13 +67,11 @@ var Server = function(requestHandler) { /** * Stops the server. - * @return {!webdriver.promise.Promise} A promise that will resolve when the + * @return {!Promise} A promise that will resolve when the * server has closed all connections. */ this.stop = function() { - var d = promise.defer(); - server.close(d.fulfill); - return d.promise; + return new Promise(resolve => server.close(resolve)); }; /** |