spec: robustify some webview tests (#17301)
This commit is contained in:
parent
14cc8a1808
commit
86291236a0
1 changed files with 10 additions and 5 deletions
|
@ -73,8 +73,9 @@ describe('<webview> tag', function () {
|
||||||
nodeIntegration: true
|
nodeIntegration: true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
const pong = emittedOnce(ipcMain, 'pong')
|
||||||
w.loadFile(path.join(fixtures, 'pages', 'webview-no-script.html'))
|
w.loadFile(path.join(fixtures, 'pages', 'webview-no-script.html'))
|
||||||
await emittedOnce(ipcMain, 'pong')
|
await pong
|
||||||
})
|
})
|
||||||
|
|
||||||
it('works with sandbox', async () => {
|
it('works with sandbox', async () => {
|
||||||
|
@ -86,8 +87,9 @@ describe('<webview> tag', function () {
|
||||||
sandbox: true
|
sandbox: true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
const pong = emittedOnce(ipcMain, 'pong')
|
||||||
w.loadFile(path.join(fixtures, 'pages', 'webview-isolated.html'))
|
w.loadFile(path.join(fixtures, 'pages', 'webview-isolated.html'))
|
||||||
await emittedOnce(ipcMain, 'pong')
|
await pong
|
||||||
})
|
})
|
||||||
|
|
||||||
it('works with contextIsolation', async () => {
|
it('works with contextIsolation', async () => {
|
||||||
|
@ -99,8 +101,9 @@ describe('<webview> tag', function () {
|
||||||
contextIsolation: true
|
contextIsolation: true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
const pong = emittedOnce(ipcMain, 'pong')
|
||||||
w.loadFile(path.join(fixtures, 'pages', 'webview-isolated.html'))
|
w.loadFile(path.join(fixtures, 'pages', 'webview-isolated.html'))
|
||||||
await emittedOnce(ipcMain, 'pong')
|
await pong
|
||||||
})
|
})
|
||||||
|
|
||||||
it('works with contextIsolation + sandbox', async () => {
|
it('works with contextIsolation + sandbox', async () => {
|
||||||
|
@ -113,8 +116,9 @@ describe('<webview> tag', function () {
|
||||||
sandbox: true
|
sandbox: true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
const pong = emittedOnce(ipcMain, 'pong')
|
||||||
w.loadFile(path.join(fixtures, 'pages', 'webview-isolated.html'))
|
w.loadFile(path.join(fixtures, 'pages', 'webview-isolated.html'))
|
||||||
await emittedOnce(ipcMain, 'pong')
|
await pong
|
||||||
})
|
})
|
||||||
|
|
||||||
it('is disabled by default', async () => {
|
it('is disabled by default', async () => {
|
||||||
|
@ -126,8 +130,9 @@ describe('<webview> tag', function () {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const webview = emittedOnce(ipcMain, 'webview')
|
||||||
w.loadFile(path.join(fixtures, 'pages', 'webview-no-script.html'))
|
w.loadFile(path.join(fixtures, 'pages', 'webview-no-script.html'))
|
||||||
const [, type] = await emittedOnce(ipcMain, 'webview')
|
const [, type] = await webview
|
||||||
|
|
||||||
expect(type).to.equal('undefined', 'WebView still exists')
|
expect(type).to.equal('undefined', 'WebView still exists')
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue