spec: window.open should inherit options of parent window

This commit is contained in:
Cheng Zhao 2015-09-22 22:36:46 +08:00
parent de41890196
commit 4521db459b
2 changed files with 18 additions and 0 deletions

View file

@ -50,6 +50,16 @@ describe 'chromium feature', ->
window.addEventListener 'message', listener
b = window.open "file://#{fixtures}/pages/window-opener-node.html", '', 'node-integration=no,show=no'
it 'inherit options of parent window', (done) ->
listener = (event) ->
window.removeEventListener 'message', listener
b.close()
size = remote.getCurrentWindow().getSize()
assert.equal event.data, "size: #{size.width} #{size.height}"
done()
window.addEventListener 'message', listener
b = window.open "file://#{fixtures}/pages/window-open-size.html", '', 'show=no'
describe 'window.opener', ->
@timeout 10000

View file

@ -0,0 +1,8 @@
<html>
<body>
<script type="text/javascript" charset="utf-8">
var size = require('remote').getCurrentWindow().getSize();
window.opener.postMessage('size: ' + size.width + ' ' + size.height, '*')
</script>
</body>
</html>