chore: remove deprecated crashed and renderer-process-crashed events (#40115)
This commit is contained in:
parent
09bab60a9e
commit
657e88b173
10 changed files with 36 additions and 93 deletions
|
|
@ -6,7 +6,6 @@ import * as http from 'node:http';
|
|||
import { BrowserWindow, ipcMain, webContents, session, app, BrowserView, WebContents } from 'electron/main';
|
||||
import { closeAllWindows } from './lib/window-helpers';
|
||||
import { ifdescribe, defer, waitUntil, listen, ifit } from './lib/spec-helpers';
|
||||
import { expectDeprecationMessages } from './lib/deprecate-helpers';
|
||||
import { once } from 'node:events';
|
||||
import { setTimeout } from 'node:timers/promises';
|
||||
|
||||
|
|
@ -2344,30 +2343,6 @@ describe('webContents module', () => {
|
|||
});
|
||||
});
|
||||
|
||||
describe('crashed event', () => {
|
||||
it('does not crash main process when destroying WebContents in it', (done) => {
|
||||
const contents = (webContents as typeof ElectronInternal.WebContents).create({ nodeIntegration: true });
|
||||
contents.once('crashed', () => {
|
||||
contents.destroy();
|
||||
done();
|
||||
});
|
||||
contents.loadURL('about:blank').then(() => contents.forcefullyCrashRenderer());
|
||||
});
|
||||
|
||||
it('logs a warning', async () => {
|
||||
const contents = (webContents as typeof ElectronInternal.WebContents).create({ nodeIntegration: true });
|
||||
await contents.loadURL('about:blank');
|
||||
|
||||
expectDeprecationMessages(async () => {
|
||||
const crashEvent = once(contents, 'crashed');
|
||||
contents.forcefullyCrashRenderer();
|
||||
const [, killed] = await crashEvent;
|
||||
|
||||
expect(killed).to.be.a('boolean');
|
||||
}, '\'crashed event\' is deprecated and will be removed. Please use \'render-process-gone event\' instead.');
|
||||
});
|
||||
});
|
||||
|
||||
describe('context-menu event', () => {
|
||||
afterEach(closeAllWindows);
|
||||
it('emits when right-clicked in page', async () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue