Read window size properly in window.open test

`BrowserWindow#getSize` returns `[width, height]`, not `{width, height}`.
This commit is contained in:
Jeff Wear 2015-12-02 11:50:44 -08:00
parent 4252c17db0
commit 32e949efed
2 changed files with 3 additions and 3 deletions

View file

@ -75,8 +75,8 @@ describe 'chromium feature', ->
it 'inherit options of parent window', (done) ->
listener = (event) ->
size = remote.getCurrentWindow().getSize()
assert.equal event.data, "size: #{size.width} #{size.height}"
[width, height] = remote.getCurrentWindow().getSize()
assert.equal event.data, "size: #{width} #{height}"
b.close()
done()
window.addEventListener 'message', listener

View file

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