test: use webContents.create() in type-safe way (#37281)
test: use (webContents as typeof ElectronInternal.WebContents).create() Co-authored-by: Milan Burda <miburda@microsoft.com>
This commit is contained in:
parent
a44e76fb70
commit
ea848bc1c5
11 changed files with 34 additions and 27 deletions
|
@ -5,7 +5,7 @@ import * as path from 'path';
|
|||
import * as util from 'util';
|
||||
import { emittedOnce } from './lib/events-helpers';
|
||||
import { getRemoteContext, ifdescribe, ifit, itremote, useRemoteContext } from './lib/spec-helpers';
|
||||
import { webContents, WebContents } from 'electron/main';
|
||||
import { webContents } from 'electron/main';
|
||||
import { EventEmitter } from 'stream';
|
||||
|
||||
const features = process._linkedBinding('electron_common_features');
|
||||
|
@ -780,7 +780,7 @@ describe('node feature', () => {
|
|||
// NOTE: temporary debug logging to try to catch flake.
|
||||
child.stderr.on('data', (m) => console.log(m.toString()));
|
||||
child.stdout.on('data', (m) => console.log(m.toString()));
|
||||
const w = (webContents as any).create({}) as WebContents;
|
||||
const w = (webContents as typeof ElectronInternal.WebContents).create();
|
||||
w.loadURL('about:blank')
|
||||
.then(() => w.executeJavaScript(`new Promise(resolve => {
|
||||
const connection = new WebSocket(${JSON.stringify(match[1])})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue