Add spec for webview visibility change on show

This commit is contained in:
Kevin Sawicki 2017-06-12 12:51:27 -07:00
Родитель ce0684aada
Коммит f1a72ad108
1 изменённых файлов: 38 добавлений и 13 удалений

Просмотреть файл

@ -1097,6 +1097,30 @@ describe('<webview> tag', function () {
})
})
describe('document.visibilityState/hidden', function () {
afterEach(function () {
ipcMain.removeAllListeners('pong')
})
it('updates when the window is shown after the ready-to-show event', function (done) {
w = new BrowserWindow({
show: false
})
w.once('ready-to-show', function () {
w.show()
})
ipcMain.on('pong', function (event, visibilityState, hidden) {
if (!hidden) {
assert.equal(visibilityState, 'visible')
done()
}
})
w.loadURL('file://' + fixtures + '/pages/webview-visibilitychange.html')
})
it('inherits the parent window visibility state and receives visibilitychange events', function (done) {
w = new BrowserWindow({
show: false
@ -1117,6 +1141,7 @@ describe('<webview> tag', function () {
w.loadURL('file://' + fixtures + '/pages/webview-visibilitychange.html')
})
})
describe('will-attach-webview event', () => {
it('supports changing the web preferences', (done) => {