mirror of
https://github.com/electron/electron.git
synced 2026-05-02 03:00:22 -04:00
chore: deprecate remote (#25293)
This commit is contained in:
@@ -42,7 +42,7 @@ export const emittedNTimes = async (emitter: NodeJS.EventEmitter, eventName: str
|
||||
};
|
||||
|
||||
export const emittedUntil = async (emitter: NodeJS.EventEmitter, eventName: string, untilFn: Function) => {
|
||||
const p = new Promise<any[][]>(resolve => {
|
||||
const p = new Promise<any[]>(resolve => {
|
||||
const handler = (...args: any[]) => {
|
||||
if (untilFn(...args)) {
|
||||
emitter.removeListener(eventName, handler);
|
||||
|
||||
@@ -625,7 +625,7 @@ describe('<webview> tag', function () {
|
||||
sandbox: sandbox.toString()
|
||||
});
|
||||
const [, webViewContents] = await emittedOnce(app, 'web-contents-created');
|
||||
const [, , message] = await emittedOnce(webViewContents, 'console-message');
|
||||
const [, , message] = await emittedUntil(webViewContents, 'console-message', (event: any, level: any, message: string) => !/deprecated/.test(message));
|
||||
|
||||
const typeOfRemote = JSON.parse(message);
|
||||
expect(typeOfRemote).to.equal('object');
|
||||
|
||||
Reference in New Issue
Block a user