spec: window.open should inherit options of parent window
This commit is contained in:
parent
de41890196
commit
4521db459b
2 changed files with 18 additions and 0 deletions
|
@ -50,6 +50,16 @@ describe 'chromium feature', ->
|
||||||
window.addEventListener 'message', listener
|
window.addEventListener 'message', listener
|
||||||
b = window.open "file://#{fixtures}/pages/window-opener-node.html", '', 'node-integration=no,show=no'
|
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', ->
|
describe 'window.opener', ->
|
||||||
@timeout 10000
|
@timeout 10000
|
||||||
|
|
||||||
|
|
8
spec/fixtures/pages/window-open-size.html
vendored
Normal file
8
spec/fixtures/pages/window-open-size.html
vendored
Normal 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>
|
Loading…
Add table
Add a link
Reference in a new issue