spec: No node integration in iframe
This commit is contained in:
parent
ef15b670a9
commit
7210f6e64d
2 changed files with 23 additions and 0 deletions
|
@ -65,3 +65,19 @@ describe 'chromium feature', ->
|
|||
assert.equal event.data, message
|
||||
done()
|
||||
worker.port.postMessage message
|
||||
|
||||
describe 'iframe', ->
|
||||
iframe = null
|
||||
|
||||
beforeEach ->
|
||||
iframe = document.createElement 'iframe'
|
||||
|
||||
afterEach ->
|
||||
document.body.removeChild iframe
|
||||
|
||||
it 'does not have node integration', (done) ->
|
||||
iframe.src = "file://#{fixtures}/pages/set-global.html"
|
||||
document.body.appendChild iframe
|
||||
iframe.onload = ->
|
||||
assert.equal iframe.contentWindow.test, 'undefined undefined undefined'
|
||||
done()
|
||||
|
|
7
spec/fixtures/pages/set-global.html
vendored
Normal file
7
spec/fixtures/pages/set-global.html
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
<html>
|
||||
<body>
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
window.test = [typeof require, typeof module, typeof process].join(' ')
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in a new issue