Wait for full screen event before leaving kiosk mode

This commit is contained in:
Kevin Sawicki 2017-04-18 16:42:01 -07:00
parent 5153c1f353
commit 6b13fab83a

View file

@ -1474,14 +1474,20 @@ describe('BrowserWindow module', function () {
// Only implemented on macOS.
if (process.platform !== 'darwin') return
it('can be changed with setKiosk method', function () {
it('can be changed with setKiosk method', function (done) {
w.destroy()
w = new BrowserWindow()
w.setKiosk(true)
assert.equal(w.isKiosk(), true)
w.once('enter-full-screen', () => {
w.setKiosk(false)
assert.equal(w.isKiosk(), false)
})
w.once('leave-full-screen', () => {
done()
})
})
})
describe('fullscreen state', function () {