spec: window.opener.postMessage should set source and origin
This commit is contained in:
parent
dddb598818
commit
c70513f7ce
2 changed files with 16 additions and 0 deletions
|
@ -63,6 +63,15 @@ describe 'chromium feature', ->
|
|||
b.close()
|
||||
done(if opener isnt null then undefined else opener)
|
||||
|
||||
describe 'window.opener.postMessage', ->
|
||||
it 'sets source and origin correctly', (done) ->
|
||||
b = window.open "file://#{fixtures}/pages/window-opener-postMessage.html", 'test', 'show=no'
|
||||
window.addEventListener 'message', (event) ->
|
||||
b.close()
|
||||
assert.equal event.source.guestId, b.guestId
|
||||
assert.equal event.origin, 'file://'
|
||||
done()
|
||||
|
||||
describe 'creating a Uint8Array under browser side', ->
|
||||
it 'does not crash', ->
|
||||
RUint8Array = remote.getGlobal 'Uint8Array'
|
||||
|
|
7
spec/fixtures/pages/window-opener-postMessage.html
vendored
Normal file
7
spec/fixtures/pages/window-opener-postMessage.html
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
<html>
|
||||
<body>
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
window.opener.postMessage('message', '*');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in a new issue