fix: do not wait on promise returned by remote APIs (#18990)
* fix: make <webview>.loadURL async * docs: webview.loadURL returns Promise
This commit is contained in:
parent
015e1348e0
commit
faa2710485
4 changed files with 21 additions and 2 deletions
|
@ -170,6 +170,20 @@ describe('<webview> tag', function () {
|
|||
expect(webview.src).to.equal('')
|
||||
}
|
||||
})
|
||||
|
||||
it('does not wait until loadURL is resolved', async () => {
|
||||
await loadWebView(webview, { src: 'about:blank' })
|
||||
|
||||
const before = Date.now()
|
||||
webview.src = 'https://github.com'
|
||||
const now = Date.now()
|
||||
|
||||
// Setting src is essentially sending a sync IPC message, which should
|
||||
// not exceed more than a few ms.
|
||||
//
|
||||
// This is for testing #18638.
|
||||
expect(now - before).to.be.below(100)
|
||||
})
|
||||
})
|
||||
|
||||
describe('nodeintegration attribute', () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue