зеркало из https://github.com/electron/electron.git
Read window size properly in `window.open` test
`BrowserWindow#getSize` returns `[width, height]`, not `{width, height}`.
This commit is contained in:
Родитель
4252c17db0
Коммит
32e949efed
|
@ -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
|
||||
|
|
|
@ -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>
|
||||
|
|
Загрузка…
Ссылка в новой задаче