From 80824b13c61e1854c11df8f459e2c4fb64618673 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 22 Nov 2013 14:42:39 +0800 Subject: [PATCH] Add spec for BrowserWindow.capturePage. --- spec/api/window.coffee | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/spec/api/window.coffee b/spec/api/window.coffee index ebaf69a422f6..66de175da971 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)