chore: remove deprecated <webview>.getWebContents() (#20986)

This commit is contained in:
Milan Burda 2019-11-08 21:46:35 +01:00 committed by John Kleinschmidt
parent 145ecb85c2
commit 093f2dd4a6
14 changed files with 26 additions and 137 deletions

View file

@ -1018,36 +1018,7 @@ describe('<webview> tag', function () {
const src = 'about:blank'
await loadWebView(webview, { src })
expect(webview.getWebContentsId()).to.be.equal(webview.getWebContents().id)
})
})
describe('<webview>.getWebContents', () => {
it('can return the webcontents associated', async () => {
const src = 'about:blank'
await loadWebView(webview, { src })
const webviewContents = webview.getWebContents()
expect(webviewContents).to.be.an('object')
expect(webviewContents.getURL()).to.equal(src)
})
})
describe('<webview>.getWebContents filtering', () => {
it('can return custom value', async () => {
const src = 'about:blank'
await loadWebView(webview, { src })
ipcRenderer.send('handle-next-remote-get-guest-web-contents', 'Hello World!')
expect(webview.getWebContents()).to.be.equal('Hello World!')
})
it('throws when no returnValue set', async () => {
const src = 'about:blank'
await loadWebView(webview, { src })
ipcRenderer.send('handle-next-remote-get-guest-web-contents')
expect(() => webview.getWebContents()).to.throw('Blocked remote.getGuestWebContents()')
expect(webview.getWebContentsId()).to.be.a('number')
})
})