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) -> it 'inherit options of parent window', (done) ->
listener = (event) -> listener = (event) ->
size = remote.getCurrentWindow().getSize() [width, height] = remote.getCurrentWindow().getSize()
assert.equal event.data, "size: #{size.width} #{size.height}" assert.equal event.data, "size: #{width} #{height}"
b.close() b.close()
done() done()
window.addEventListener 'message', listener window.addEventListener 'message', listener

View file

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