openedWindow -> popupWindow
This commit is contained in:
parent
766f5afabd
commit
d942694695
1 changed files with 7 additions and 4 deletions
|
@ -698,7 +698,7 @@ describe('browser-window module', function () {
|
||||||
})
|
})
|
||||||
let htmlPath = path.join(fixtures, 'api', 'sandbox.html?window-open-external')
|
let htmlPath = path.join(fixtures, 'api', 'sandbox.html?window-open-external')
|
||||||
const pageUrl = 'file://' + htmlPath
|
const pageUrl = 'file://' + htmlPath
|
||||||
let openedWindow
|
let popupWindow
|
||||||
w.loadURL(pageUrl)
|
w.loadURL(pageUrl)
|
||||||
w.webContents.once('new-window', (e, url, frameName, disposition, options) => {
|
w.webContents.once('new-window', (e, url, frameName, disposition, options) => {
|
||||||
assert.equal(url, 'http://www.google.com/#q=electron')
|
assert.equal(url, 'http://www.google.com/#q=electron')
|
||||||
|
@ -712,15 +712,18 @@ describe('browser-window module', function () {
|
||||||
ipcMain.once('answer', function (event, exceptionMessage) {
|
ipcMain.once('answer', function (event, exceptionMessage) {
|
||||||
assert(/Blocked a frame with origin/.test(exceptionMessage))
|
assert(/Blocked a frame with origin/.test(exceptionMessage))
|
||||||
|
|
||||||
// FIXME this opened window should be closed in sandbox.html
|
// FIXME this popup window should be closed in sandbox.html
|
||||||
closeWindow(openedWindow).then(done)
|
closeWindow(popupWindow).then(() => {
|
||||||
|
popupWindow = null
|
||||||
|
done()
|
||||||
|
})
|
||||||
})
|
})
|
||||||
w.webContents.send('child-loaded')
|
w.webContents.send('child-loaded')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
app.once('browser-window-created', function (event, window) {
|
app.once('browser-window-created', function (event, window) {
|
||||||
openedWindow = window
|
popupWindow = window
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue