Add failing spec
This commit is contained in:
parent
c92e622ce0
commit
e4bd592e0e
4 changed files with 73 additions and 0 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue