Add failing spec

This commit is contained in:
Kevin Sawicki 2016-04-21 11:49:42 -07:00
parent c92e622ce0
commit e4bd592e0e
4 changed files with 73 additions and 0 deletions

View file

@ -84,6 +84,39 @@ describe('<webview> tag', function () {
document.body.appendChild(webview)
})
it('disables node integration when disabled on the parent BrowserWindow', function (done) {
var b = undefined
ipcMain.once('answer', function (event, typeofProcess) {
try {
assert.equal(typeofProcess, 'undefined')
done()
} finally {
b.close()
}
})
var windowUrl = require('url').format({
pathname: `${fixtures}/pages/webview-no-node-integration-on-window.html`,
protocol: 'file',
query: {
p: `${fixtures}/pages/web-view-log-process.html`
},
slashes: true
})
var preload = path.join(fixtures, 'module', 'answer.js')
b = new BrowserWindow({
height: 400,
width: 400,
show: false,
webPreferences: {
preload: preload,
nodeIntegration: false,
}
})
b.loadURL(windowUrl)
})
it('disables node integration on child windows when it is disabled on the webview', function (done) {
app.once('browser-window-created', function (event, window) {