robustify async webview test
This commit is contained in:
parent
6d4480ea6b
commit
8c1b5311fd
1 changed files with 4 additions and 2 deletions
|
@ -1332,10 +1332,12 @@ describe('<webview> tag', function () {
|
||||||
nodeIntegration: true
|
nodeIntegration: true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
const didAttachWebview = emittedOnce(w.webContents, 'did-attach-webview')
|
||||||
|
const webviewDomReady = emittedOnce(ipcMain, 'webview-dom-ready')
|
||||||
w.loadFile(path.join(fixtures, 'pages', 'webview-did-attach-event.html'))
|
w.loadFile(path.join(fixtures, 'pages', 'webview-did-attach-event.html'))
|
||||||
|
|
||||||
const [, webContents] = await emittedOnce(w.webContents, 'did-attach-webview')
|
const [, webContents] = await didAttachWebview
|
||||||
const [, id] = await emittedOnce(ipcMain, 'webview-dom-ready')
|
const [, id] = await webviewDomReady
|
||||||
expect(webContents.id).to.equal(id)
|
expect(webContents.id).to.equal(id)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue