feat: add additional remote APIs filtering (#16293)

This commit is contained in:
Milan Burda 2019-01-08 23:27:56 +01:00 committed by Jeremy Apthorp
parent 6436a12d7f
commit 349a3c20ae
8 changed files with 323 additions and 69 deletions

View file

@ -1188,6 +1188,24 @@ describe('<webview> tag', function () {
})
})
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.getGuestForWebContents()')
})
})
// FIXME(deepak1556): Ch69 follow up.
xdescribe('document.visibilityState/hidden', () => {
afterEach(() => {