From 284ca3114bce8e096b2f86f315f6c214d4a2212f Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 24 Jan 2017 08:29:50 -0800 Subject: [PATCH] Wait for window to transition before leaving full screen --- spec/api-browser-window-spec.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/spec/api-browser-window-spec.js b/spec/api-browser-window-spec.js index a07f301c8b37..74807e4728ed 100644 --- a/spec/api-browser-window-spec.js +++ b/spec/api-browser-window-spec.js @@ -1437,13 +1437,16 @@ describe('BrowserWindow module', function () { // Only implemented on macOS. if (process.platform !== 'darwin') return - it('can be changed with setFullScreen method', function () { + it('can be changed with setFullScreen method', function (done) { w.destroy() w = new BrowserWindow() + w.once('enter-full-screen', () => { + w.setFullScreen(false) + assert.equal(w.isFullScreen(), false) + done() + }) w.setFullScreen(true) assert.equal(w.isFullScreen(), true) - w.setFullScreen(false) - assert.equal(w.isFullScreen(), false) }) it('should not be changed by setKiosk method', function () {