fix: correctly enable and disable windows on Windows and Linux (#15184)

This commit is contained in:
Michelle Tilley 2018-10-18 14:23:40 -07:00 committed by GitHub
parent 7cab7b6c7e
commit 51f3fb9bde
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 54 additions and 17 deletions

View file

@ -3014,7 +3014,7 @@ describe('BrowserWindow module', () => {
c.show()
assert.strictEqual(w.isEnabled(), false)
})
it('enables parent window when closed', (done) => {
it('re-enables an enabled parent window when closed', (done) => {
c.once('closed', () => {
assert.strictEqual(w.isEnabled(), true)
done()
@ -3022,6 +3022,15 @@ describe('BrowserWindow module', () => {
c.show()
c.close()
})
it('does not re-enable a disabled parent window when closed', (done) => {
c.once('closed', () => {
assert.strictEqual(w.isEnabled(), false)
done()
})
w.setEnabled(false)
c.show()
c.close()
})
it('disables parent window recursively', () => {
const c2 = new BrowserWindow({ show: false, parent: w, modal: true })
c.show()