exit HTML fullscreen when window leaves fullscreen (#13090)

This commit is contained in:
Milan Burda 2018-06-18 09:48:20 +02:00 committed by Cheng Zhao
parent 28fd571d0c
commit 2eb5b751f3
3 changed files with 32 additions and 0 deletions

View file

@ -2590,6 +2590,29 @@ describe('BrowserWindow module', () => {
})
})
describe('BrowserWindow.setFullScreen(false) when HTML fullscreen', () => {
before(function () {
if (process.platform !== 'darwin') {
this.skip()
}
})
it('exits HTML fullscreen when window leaves fullscreen', (done) => {
w.destroy()
w = new BrowserWindow()
w.webContents.once('did-finish-load', () => {
w.once('enter-full-screen', () => {
w.once('leave-html-full-screen', () => {
done()
})
w.setFullScreen(false)
})
w.webContents.executeJavaScript('document.body.webkitRequestFullscreen()', true)
})
w.loadURL('about:blank')
})
})
describe('parent window', () => {
let c = null