mirror of
https://github.com/electron/electron.git
synced 2026-02-08 06:05:03 -05:00
robustify async webview test
This commit is contained in:
@@ -1332,10 +1332,12 @@ describe('<webview> tag', function () {
|
||||
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'))
|
||||
|
||||
const [, webContents] = await emittedOnce(w.webContents, 'did-attach-webview')
|
||||
const [, id] = await emittedOnce(ipcMain, 'webview-dom-ready')
|
||||
const [, webContents] = await didAttachWebview
|
||||
const [, id] = await webviewDomReady
|
||||
expect(webContents.id).to.equal(id)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user