From a6660149904ad3c2d3120b48be203f1cb90033ae Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 25 Nov 2014 14:52:49 +0800 Subject: [PATCH] spec: Window state events --- spec/api-browser-window-spec.coffee | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/spec/api-browser-window-spec.coffee b/spec/api-browser-window-spec.coffee index c81e1731d5ae..68f8d1f2a2de 100644 --- a/spec/api-browser-window-spec.coffee +++ b/spec/api-browser-window-spec.coffee @@ -183,3 +183,24 @@ describe 'browser-window module', -> assert.equal frameName, 'target' done() w.loadUrl "file://#{fixtures}/pages/target-name.html" + + describe 'maximize event', -> + it 'emits when window is maximized', (done) -> + w.once 'maximize', -> done() + w.maximize() + + describe 'unmaximize event', -> + it 'emits when window is unmaximized', (done) -> + w.once 'unmaximize', -> done() + w.unmaximize() + + describe 'minimize event', -> + it 'emits when window is minimized', (done) -> + w.once 'minimize', -> done() + w.minimize() + + describe 'restore event', -> + it 'emits when window is restored', (done) -> + w.once 'restore', -> done() + w.minimize() + w.restore()