From: Cheng Zhao Date: Tue, 21 Jul 2015 02:16:02 +0000 (+0800) Subject: spec: Test setContentSize for frameless window X-Git-Tag: v0.30.1~15^2~2 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=f25cf7481fc310afbd32d1954e56e43f40ef7027;p=electron.git spec: Test setContentSize for frameless window --- diff --git a/spec/api-browser-window-spec.coffee b/spec/api-browser-window-spec.coffee index ce128243..c6325426 100644 --- a/spec/api-browser-window-spec.coffee +++ b/spec/api-browser-window-spec.coffee @@ -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'