Add failing spec for nodeIntegration inheritance
This commit is contained in:
parent
afdad927b7
commit
777704e659
2 changed files with 36 additions and 0 deletions
|
@ -182,6 +182,27 @@ describe('chromium feature', function () {
|
|||
b = window.open('file://' + fixtures + '/pages/window-open-size.html', '', 'show=no')
|
||||
})
|
||||
|
||||
it('disables node integration when it is disabled on the parent window', function (done) {
|
||||
var b
|
||||
listener = function (event) {
|
||||
assert.equal(event.data, 'undefined')
|
||||
b.close()
|
||||
done()
|
||||
}
|
||||
window.addEventListener('message', listener)
|
||||
|
||||
var windowUrl = require('url').format({
|
||||
pathname: fixtures + "/pages/window-opener-no-node-integration.html",
|
||||
protocol: 'file',
|
||||
query: {
|
||||
p: fixtures + "/pages/window-opener-node.html"
|
||||
},
|
||||
slashes: true
|
||||
})
|
||||
console.log(windowUrl)
|
||||
b = window.open(windowUrl, 'nodeIntegration=no,show=no')
|
||||
})
|
||||
|
||||
it('does not override child options', function (done) {
|
||||
var b, size
|
||||
size = {
|
||||
|
|
15
spec/fixtures/pages/window-opener-no-node-integration.html
vendored
Normal file
15
spec/fixtures/pages/window-opener-no-node-integration.html
vendored
Normal file
|
@ -0,0 +1,15 @@
|
|||
<html>
|
||||
<body>
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
var windowUrl = decodeURIComponent(window.location.search.substring(3))
|
||||
var opened = window.open('file://' + windowUrl, '', 'nodeIntegration=yes,show=no')
|
||||
window.addEventListener('message', function (event) {
|
||||
try {
|
||||
opened.close();
|
||||
} finally {
|
||||
window.opener.postMessage(event.data, '*');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in a new issue