mirror of
https://github.com/cypress-io/cypress.git
synced 2026-02-11 01:29:59 -06:00
fix: close chrome when closing electron (#19322)
This commit is contained in:
committed by
GitHub
parent
65cf6e899d
commit
f79bdd665a
@@ -520,13 +520,13 @@ export = {
|
||||
const originalBrowserKill = launchedBrowser.kill
|
||||
|
||||
/* @ts-expect-error */
|
||||
launchedBrowser.kill = async (...args) => {
|
||||
launchedBrowser.kill = (...args) => {
|
||||
debug('closing remote interface client')
|
||||
|
||||
await criClient.close()
|
||||
criClient.close()
|
||||
debug('closing chrome')
|
||||
|
||||
await originalBrowserKill.apply(launchedBrowser, args)
|
||||
originalBrowserKill.apply(launchedBrowser, args)
|
||||
}
|
||||
|
||||
await this._maybeRecordVideo(criClient, options, browser.majorVersion)
|
||||
|
||||
@@ -191,7 +191,6 @@ export const create = Bluebird.method((target: websocketUrl, onAsynchronousError
|
||||
maybeDebugCdpMessages(cri)
|
||||
|
||||
cri.send = Bluebird.promisify(cri.send, { context: cri })
|
||||
cri.close = Bluebird.promisify(cri.close, { context: cri })
|
||||
|
||||
// @see https://github.com/cyrus-and/chrome-remote-interface/issues/72
|
||||
cri._notifier.on('disconnect', reconnect)
|
||||
|
||||
@@ -300,10 +300,9 @@ describe('lib/browsers/chrome', () => {
|
||||
.then(() => {
|
||||
expect(this.launchedBrowser.kill).to.be.a('function')
|
||||
|
||||
return this.launchedBrowser.kill()
|
||||
}).then(() => {
|
||||
expect(this.criClient.close).to.be.calledOnce
|
||||
this.launchedBrowser.kill()
|
||||
|
||||
expect(this.criClient.close).to.be.calledOnce
|
||||
expect(kill).to.be.calledOnce
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user