Add spec for window.open with webPreferences set to null

This commit is contained in:
Samuel Attard 2016-10-07 12:13:04 +11:00
parent 09e5035ab5
commit a0284a9bc5
No known key found for this signature in database
GPG key ID: 273DC1869D8F13EF

View file

@ -828,6 +828,19 @@ describe('browser-window module', function () {
w.loadURL('file://' + fixtures + '/pages/window-open.html')
})
it('emits when window.open is called with no webPreferences', function (done) {
w.destroy()
w = new BrowserWindow({ show: false })
w.webContents.once('new-window', function (e, url, frameName, disposition, options, additionalFeatures) {
e.preventDefault()
assert.equal(url, 'http://host/')
assert.equal(frameName, 'host')
assert.equal(additionalFeatures[0], 'this-is-not-a-standard-feature')
done()
})
w.loadURL('file://' + fixtures + '/pages/window-open.html')
})
it('emits when link with target is called', function (done) {
this.timeout(10000)
w.webContents.once('new-window', function (e, url, frameName) {