* Creates a new DriverService using this instance's current configuration. * * @return {!DriverService} A new driver service.
()
| 435 | * @return {!DriverService} A new driver service. |
| 436 | */ |
| 437 | build() { |
| 438 | let port = this.options_.port || portprober.findFreePort() |
| 439 | let args = Promise.resolve(port).then((port) => { |
| 440 | return this.options_.args.concat('--port=' + port) |
| 441 | }) |
| 442 | |
| 443 | let options = |
| 444 | /** @type {!ServiceOptions} */ |
| 445 | (Object.assign({}, this.options_, { args, port })) |
| 446 | return new DriverService(this.exe_, options) |
| 447 | } |
| 448 | } |
| 449 | |
| 450 | /** |