test: re-add accidentally deleted test (#19282)
this was lost due to a tragic merge incident in #19182
This commit is contained in:
parent
3ded946686
commit
42f283c281
1 changed files with 21 additions and 0 deletions
|
@ -2083,6 +2083,27 @@ describe('BrowserWindow module', () => {
|
||||||
expect(content).to.equal('function')
|
expect(content).to.equal('function')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
it('<webview> works in a scriptable popup', (done) => {
|
||||||
|
const preload = path.join(fixtures, 'api', 'new-window-webview-preload.js')
|
||||||
|
|
||||||
|
const w = new BrowserWindow({
|
||||||
|
show: false,
|
||||||
|
webPreferences: {
|
||||||
|
nodeIntegrationInSubFrames: true,
|
||||||
|
nativeWindowOpen: true,
|
||||||
|
webviewTag: true,
|
||||||
|
preload
|
||||||
|
}
|
||||||
|
})
|
||||||
|
w.webContents.once('new-window', (event, url, frameName, disposition, options) => {
|
||||||
|
options.show = false
|
||||||
|
})
|
||||||
|
|
||||||
|
ipcMain.once('webview-loaded', () => {
|
||||||
|
done()
|
||||||
|
})
|
||||||
|
w.loadFile(path.join(fixtures, 'api', 'new-window-webview.html'))
|
||||||
|
})
|
||||||
it('should inherit the nativeWindowOpen setting in opened windows', async () => {
|
it('should inherit the nativeWindowOpen setting in opened windows', async () => {
|
||||||
const preloadPath = path.join(fixtures, 'api', 'new-window-preload.js')
|
const preloadPath = path.join(fixtures, 'api', 'new-window-preload.js')
|
||||||
w.webContents.once('new-window', (event, url, frameName, disposition, options) => {
|
w.webContents.once('new-window', (event, url, frameName, disposition, options) => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue