From 07f0de6508c3b94a79c462af3d7aa0380e9a4e8f Mon Sep 17 00:00:00 2001 From: Erick Zhao Date: Thu, 27 Jun 2019 15:24:49 -0700 Subject: [PATCH] =?UTF-8?q?destroy=20=F0=9F=9A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spec/api-browser-window-spec.js | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/spec/api-browser-window-spec.js b/spec/api-browser-window-spec.js index 5b2f5a3f66fee..2068730ac2517 100644 --- a/spec/api-browser-window-spec.js +++ b/spec/api-browser-window-spec.js @@ -2332,7 +2332,7 @@ describe('BrowserWindow module', () => { describe('focus event', () => { it('should not emit if focusing on a main window with a modal open', (done) => { - let childWindowClosed = false + const childWindowClosed = false const child = new BrowserWindow({ parent: w, modal: true, @@ -2345,23 +2345,13 @@ describe('BrowserWindow module', () => { child.on('show', () => { w.once('focus', () => { - expect(childWindowClosed).to.equal(true, - 'Main window should only regain focus once the modal is closed') + expect(child.isDestroyed()).to.equal(true) done() }) w.focus() // this should not trigger the above listener child.close() }) - // trying stuff... - child.on('close', () => { - childWindowClosed = true - }) - - child.on('closed', () => { - childWindowClosed = true - }) - // act child.loadURL(server.url) w.show()