mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
test: fix "crashed event does not crash main process when destroying WebContents in it" (#40148)
test: fix "crashed event does not crash main process when destroying WebContents in it" (#40135) Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Milan Burda <milan.burda@gmail.com>
This commit is contained in:
@@ -2258,13 +2258,13 @@ describe('webContents module', () => {
|
||||
});
|
||||
|
||||
describe('crashed event', () => {
|
||||
it('does not crash main process when destroying WebContents in it', async () => {
|
||||
it('does not crash main process when destroying WebContents in it', (done) => {
|
||||
const contents = (webContents as typeof ElectronInternal.WebContents).create({ nodeIntegration: true });
|
||||
const crashEvent = once(contents, 'render-process-gone');
|
||||
await contents.loadURL('about:blank');
|
||||
contents.forcefullyCrashRenderer();
|
||||
await crashEvent;
|
||||
contents.destroy();
|
||||
contents.once('crashed', () => {
|
||||
contents.destroy();
|
||||
done();
|
||||
});
|
||||
contents.loadURL('about:blank').then(() => contents.forcefullyCrashRenderer());
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user