spec: disablewebsecurity should not break preload and node integration
This commit is contained in:
parent
7ec467e337
commit
ce0d3d93ab
2 changed files with 25 additions and 1 deletions
|
@ -29,7 +29,7 @@ describe('ipc module', function () {
|
||||||
assert.equal(a.id, 1127)
|
assert.equal(a.id, 1127)
|
||||||
})
|
})
|
||||||
|
|
||||||
it.only('should work when object has no prototype', function () {
|
it('should work when object has no prototype', function () {
|
||||||
var a = remote.require(path.join(fixtures, 'module', 'no-prototype.js'))
|
var a = remote.require(path.join(fixtures, 'module', 'no-prototype.js'))
|
||||||
assert.equal(a.foo.bar, 'baz')
|
assert.equal(a.foo.bar, 'baz')
|
||||||
assert.equal(a.foo.baz, false)
|
assert.equal(a.foo.baz, false)
|
||||||
|
|
|
@ -259,6 +259,30 @@ describe('<webview> tag', function () {
|
||||||
webview.src = 'data:text/html;base64,' + encoded
|
webview.src = 'data:text/html;base64,' + encoded
|
||||||
document.body.appendChild(webview)
|
document.body.appendChild(webview)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('does not break node integration', function (done) {
|
||||||
|
webview.addEventListener('console-message', function (e) {
|
||||||
|
assert.equal(e.message, 'function object object')
|
||||||
|
done()
|
||||||
|
})
|
||||||
|
webview.setAttribute('nodeintegration', 'on')
|
||||||
|
webview.setAttribute('disablewebsecurity', '')
|
||||||
|
webview.src = 'file://' + fixtures + '/pages/d.html'
|
||||||
|
document.body.appendChild(webview)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('does not break preload script', function (done) {
|
||||||
|
var listener = function (e) {
|
||||||
|
assert.equal(e.message, 'function object object')
|
||||||
|
webview.removeEventListener('console-message', listener)
|
||||||
|
done()
|
||||||
|
}
|
||||||
|
webview.addEventListener('console-message', listener)
|
||||||
|
webview.setAttribute('disablewebsecurity', '')
|
||||||
|
webview.setAttribute('preload', fixtures + '/module/preload.js')
|
||||||
|
webview.src = 'file://' + fixtures + '/pages/e.html'
|
||||||
|
document.body.appendChild(webview)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('partition attribute', function () {
|
describe('partition attribute', function () {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue