From 42f283c281532ef5e690700e604ab7d0e79ee244 Mon Sep 17 00:00:00 2001 From: Jeremy Apthorp Date: Tue, 16 Jul 2019 15:45:35 -0700 Subject: [PATCH] test: re-add accidentally deleted test (#19282) this was lost due to a tragic merge incident in #19182 --- spec-main/api-browser-window-spec.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/spec-main/api-browser-window-spec.ts b/spec-main/api-browser-window-spec.ts index 9c5a958cd3db..03145918b11f 100644 --- a/spec-main/api-browser-window-spec.ts +++ b/spec-main/api-browser-window-spec.ts @@ -2083,6 +2083,27 @@ describe('BrowserWindow module', () => { expect(content).to.equal('function') } }) + it(' 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 () => { const preloadPath = path.join(fixtures, 'api', 'new-window-preload.js') w.webContents.once('new-window', (event, url, frameName, disposition, options) => {