chore: deprecate remote (#25293)

This commit is contained in:
Jeremy Rose
2020-09-10 09:17:17 -07:00
committed by GitHub
parent 98683190b4
commit dd781c4f63
4 changed files with 24 additions and 2 deletions

View File

@@ -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);

View File

@@ -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');