test: use node helpers for events.once and setTimeout promise (#37374)
This commit is contained in:
parent
46c8b9c728
commit
a3e3efe4c4
47 changed files with 932 additions and 927 deletions
|
@ -6,8 +6,8 @@ import * as url from 'url';
|
|||
import * as WebSocket from 'ws';
|
||||
import { ipcMain, protocol, session, WebContents, webContents } from 'electron/main';
|
||||
import { Socket } from 'net';
|
||||
import { emittedOnce } from './lib/events-helpers';
|
||||
import { listen } from './lib/spec-helpers';
|
||||
import { once } from 'events';
|
||||
|
||||
const fixturesPath = path.resolve(__dirname, 'fixtures');
|
||||
|
||||
|
@ -545,7 +545,7 @@ describe('webRequest module', () => {
|
|||
});
|
||||
|
||||
contents.loadFile(path.join(fixturesPath, 'api', 'webrequest.html'), { query: { port: `${port}` } });
|
||||
await emittedOnce(ipcMain, 'websocket-success');
|
||||
await once(ipcMain, 'websocket-success');
|
||||
|
||||
expect(receivedHeaders['/websocket'].Upgrade[0]).to.equal('websocket');
|
||||
expect(receivedHeaders['/'].foo1[0]).to.equal('bar1');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue