Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.chromedriver.on(Chromedriver.EVENT_CHANGED, function (msg) {
if (msg.state === Chromedriver.STATE_STOPPED) {
// bind our stop/exit handler, passing in context so we know which
// one stopped unexpectedly
this.onChromedriverStop(context);
}
}.bind(this));
this.chromedriver.start(caps).nodeify(function (err) {
it('should handle chromedriver event with STATE_STOPPED state', async function () {
await driver.startChromedriverProxy('WEBVIEW_1');
await driver.chromedriver.emit(Chromedriver.EVENT_CHANGED,
{state: Chromedriver.STATE_STOPPED});
driver.onChromedriverStop.calledWithExactly('WEBVIEW_1').should.be.true;
});
it('should ignore events if status is not STATE_STOPPED', async function () {
this.chromedriver.on(Chromedriver.EVENT_CHANGED, (msg) => {
if (msg.state === Chromedriver.STATE_STOPPED) {
this.onChromedriverStop(CHROMIUM_WIN);
}
});
this.chromedriver.on(Chromedriver.EVENT_CHANGED, function (msg) {
if (msg.state === Chromedriver.STATE_STOPPED) {
logger.info("Chromedriver stopped unexpectedly on us, shutting down " +
"then calling back up with the on-die callback");
this.onChromedriverStop(this.onDieCb);
}
}.bind(this));
this.chromedriver.start(caps).nodeify(function (err) {