Skip to content

Commit

Permalink
added onQuit handler for chromedriver
Browse files Browse the repository at this point in the history
  • Loading branch information
corevo committed Sep 8, 2019
1 parent 5caa106 commit 4e62dd5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion javascript/node/selenium-webdriver/chrome.js
Original file line number Diff line number Diff line change
Expand Up @@ -687,12 +687,14 @@ class Driver extends webdriver.WebDriver {
*/
static createSession(opt_config, opt_serviceExecutor) {
let executor;
let onQuit;
if (opt_serviceExecutor instanceof http.Executor) {
executor = opt_serviceExecutor;
configureExecutor(executor);
} else {
let service = opt_serviceExecutor || getDefaultService();
executor = createExecutor(service.start());
onQuit = () => service.kill();
}

let caps = opt_config || Capabilities.chrome();
Expand All @@ -707,7 +709,7 @@ class Driver extends webdriver.WebDriver {
}
}

return /** @type {!Driver} */(super.createSession(executor, caps));
return /** @type {!Driver} */(super.createSession(executor, caps, onQuit));
}

/**
Expand Down

0 comments on commit 4e62dd5

Please sign in to comment.