test: convert a few more specs to async/await (#39712)

This commit is contained in:
Milan Burda 2023-09-04 12:33:29 +02:00 committed by GitHub
parent 54d8402a6c
commit f27b034045
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 70 additions and 89 deletions

View file

@ -263,7 +263,7 @@ describe('protocol module', () => {
expect(r.headers).to.have.property('x-great-header', 'sogreat');
});
it('can load iframes with custom protocols', (done) => {
it('can load iframes with custom protocols', async () => {
registerFileProtocol('custom', (request, callback) => {
const filename = request.url.substring(9);
const p = path.join(__dirname, 'fixtures', 'pages', filename);
@ -278,8 +278,9 @@ describe('protocol module', () => {
}
});
const loaded = once(ipcMain, 'loaded-iframe-custom-protocol');
w.loadFile(path.join(__dirname, 'fixtures', 'pages', 'iframe-protocol.html'));
ipcMain.once('loaded-iframe-custom-protocol', () => done());
await loaded;
});
it('sends object as response', async () => {