test: use render-process-gone event in tests (#37280)

Co-authored-by: Milan Burda <miburda@microsoft.com>
This commit is contained in:
Milan Burda 2023-02-16 10:25:41 +01:00 committed by GitHub
parent fdab0799fe
commit beed240454
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 12 deletions

View file

@ -2226,8 +2226,8 @@ describe('webContents module', () => {
describe('crashed event', () => {
it('does not crash main process when destroying WebContents in it', (done) => {
const contents = (webContents as any).create({ nodeIntegration: true });
contents.once('crashed', () => {
const contents = (webContents as typeof ElectronInternal.WebContents).create({ nodeIntegration: true });
contents.once('render-process-gone', () => {
contents.destroy();
done();
});