Skip to content

Commit

Permalink
destroy 馃毃
Browse files Browse the repository at this point in the history
  • Loading branch information
erickzhao authored and electron-bot committed Jul 1, 2019
1 parent 43c7460 commit 07f0de6
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions spec/api-browser-window-spec.js
Expand Up @@ -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,
Expand All @@ -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()
Expand Down

0 comments on commit 07f0de6

Please sign in to comment.