]> khamidou — GitHub mirrors - electron.git/commitdiff
spec: Test setContentSize for frameless window
authorCheng Zhao <zcbenz@gmail.com>
Tue, 21 Jul 2015 02:16:02 +0000 (10:16 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Tue, 21 Jul 2015 02:17:38 +0000 (10:17 +0800)
spec/api-browser-window-spec.coffee

index ce1282439a2daff09254ec484b7451c962523ef8..c63254261779e1d103cc9af7a9108fd084e32a0c 100644 (file)
@@ -117,6 +117,15 @@ describe 'browser-window module', ->
       assert.equal after[0], size[0]
       assert.equal after[1], size[1]
 
+    it 'works for framless window', ->
+      w.destroy()
+      w = new BrowserWindow(show: false, frame: false, width: 400, height: 400)
+      size = [400, 400]
+      w.setContentSize size[0], size[1]
+      after = w.getContentSize()
+      assert.equal after[0], size[0]
+      assert.equal after[1], size[1]
+
   describe 'BrowserWindow.fromId(id)', ->
     it 'returns the window with id', ->
       assert.equal w.id, BrowserWindow.fromId(w.id).id
@@ -134,6 +143,16 @@ describe 'browser-window module', ->
       assert.equal size[0], 400
       assert.equal size[1], 400
 
+    it 'works for framless window', ->
+      w.destroy()
+      w = new BrowserWindow(show: false, frame: false, width: 400, height: 400, 'use-content-size': true)
+      contentSize = w.getContentSize()
+      assert.equal contentSize[0], 400
+      assert.equal contentSize[1], 400
+      size = w.getSize()
+      assert.equal size[0], 400
+      assert.equal size[1], 400
+
   describe '"enable-larger-than-screen" option', ->
     return if process.platform is 'linux'