From: Cheng Zhao Date: Fri, 22 Nov 2013 06:42:39 +0000 (+0800) Subject: Add spec for BrowserWindow.capturePage. X-Git-Tag: v0.6.12~1^2 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=80824b13c61e1854c11df8f459e2c4fb64618673;p=electron.git Add spec for BrowserWindow.capturePage. --- diff --git a/spec/api/window.coffee b/spec/api/window.coffee index ebaf69a4..66de175d 100644 --- a/spec/api/window.coffee +++ b/spec/api/window.coffee @@ -75,6 +75,13 @@ describe 'window module', -> assert.equal w.isVisible(), false w.close() + describe 'BrowserWindow.capturePage(rect, callback)', -> + it 'calls the callback with a Buffer', -> + w = new BrowserWindow(show: false) + w.capturePage {x: 0, y: 0, width: 100, height: 100}, (image) -> + assert.equal image.constructor.name, 'SlowBuffer' + w.close() + describe 'beforeunload handler', -> it 'returning true would not prevent close', (done) -> w = new BrowserWindow(show: false)