Browse Source

Read window size properly in `window.open` test

`BrowserWindow#getSize` returns `[width, height]`, not `{width, height}`.
Jeff Wear 9 years ago
parent
commit
32e949efed
2 changed files with 3 additions and 3 deletions
  1. 2 2
      spec/chromium-spec.coffee
  2. 1 1
      spec/fixtures/pages/window-open-size.html

+ 2 - 2
spec/chromium-spec.coffee

@@ -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

+ 1 - 1
spec/fixtures/pages/window-open-size.html

@@ -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>