fix: remove catch-all HandleScope (#22531)
This commit is contained in:
parent
4bca5205bb
commit
19314d3caf
21 changed files with 131 additions and 75 deletions
|
@ -1,5 +1,8 @@
|
|||
import { expect } from 'chai'
|
||||
import { BrowserWindow, ipcMain, IpcMainInvokeEvent } from 'electron'
|
||||
import { emittedOnce } from './events-helpers'
|
||||
|
||||
const v8Util = process.electronBinding('v8_util')
|
||||
|
||||
describe('ipc module', () => {
|
||||
describe('invoke', () => {
|
||||
|
@ -103,6 +106,17 @@ describe('ipc module', () => {
|
|||
ipcMain.removeHandler('test')
|
||||
}
|
||||
})
|
||||
|
||||
it('throws an error in the renderer if the reply callback is dropped', async () => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
ipcMain.handleOnce('test', () => new Promise(resolve => {
|
||||
setTimeout(() => v8Util.requestGarbageCollectionForTesting())
|
||||
/* never resolve */
|
||||
}))
|
||||
w.webContents.executeJavaScript(`(${rendererInvoke})()`)
|
||||
const [, { error }] = await emittedOnce(ipcMain, 'result')
|
||||
expect(error).to.match(/reply was never sent/)
|
||||
})
|
||||
})
|
||||
|
||||
describe('ordering', () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue