Skip to content

Commit 7210f6e

Browse files
committed
spec: No node integration in iframe
1 parent ef15b67 commit 7210f6e

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

spec/chromium-spec.coffee

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,19 @@ describe 'chromium feature', ->
6565
assert.equal event.data, message
6666
done()
6767
worker.port.postMessage message
68+
69+
describe 'iframe', ->
70+
iframe = null
71+
72+
beforeEach ->
73+
iframe = document.createElement 'iframe'
74+
75+
afterEach ->
76+
document.body.removeChild iframe
77+
78+
it 'does not have node integration', (done) ->
79+
iframe.src = "file://#{fixtures}/pages/set-global.html"
80+
document.body.appendChild iframe
81+
iframe.onload = ->
82+
assert.equal iframe.contentWindow.test, 'undefined undefined undefined'
83+
done()

spec/fixtures/pages/set-global.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<html>
2+
<body>
3+
<script type="text/javascript" charset="utf-8">
4+
window.test = [typeof require, typeof module, typeof process].join(' ')
5+
</script>
6+
</body>
7+
</html>

0 commit comments

Comments
 (0)