зеркало из https://github.com/electron/electron.git
Add spec for webview visibility change on show
This commit is contained in:
Родитель
ce0684aada
Коммит
f1a72ad108
|
@ -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) => {
|
||||
|
|
Загрузка…
Ссылка в новой задаче