Add new-window <webview> spec with nativeWindowOpen

This commit is contained in:
Kevin Sawicki 2017-05-23 13:32:16 -07:00
parent da2b29796f
commit a2a7a1d8c7

View file

@ -524,6 +524,17 @@ describe('<webview> tag', function () {
webview.src = 'file://' + fixtures + '/pages/target-name.html' webview.src = 'file://' + fixtures + '/pages/target-name.html'
document.body.appendChild(webview) document.body.appendChild(webview)
}) })
it('emits when nativeWindowOpen is enabled', function(done) {
webview.addEventListener('new-window', function (e) {
assert.equal(e.url, 'http://host/')
assert.equal(e.frameName, 'host')
done()
})
webview.setAttribute('webpreferences', 'nativeWindowOpen=1')
webview.src = 'file://' + fixtures + '/pages/window-open.html'
document.body.appendChild(webview)
})
}) })
describe('ipc-message event', function () { describe('ipc-message event', function () {