mirror of
https://github.com/electron/electron.git
synced 2026-01-26 15:58:07 -05:00
Explicitly close popup window
This commit is contained in:
@@ -698,6 +698,7 @@ describe('browser-window module', function () {
|
||||
})
|
||||
let htmlPath = path.join(fixtures, 'api', 'sandbox.html?window-open-external')
|
||||
const pageUrl = 'file://' + htmlPath
|
||||
let openedWindow
|
||||
w.loadURL(pageUrl)
|
||||
w.webContents.once('new-window', (e, url, frameName, disposition, options) => {
|
||||
assert.equal(url, 'http://www.google.com/#q=electron')
|
||||
@@ -710,11 +711,17 @@ describe('browser-window module', function () {
|
||||
assert.equal(html, '<h1>http://www.google.com/#q=electron</h1>')
|
||||
ipcMain.once('answer', function (event, exceptionMessage) {
|
||||
assert(/Blocked a frame with origin/.test(exceptionMessage))
|
||||
done()
|
||||
|
||||
// FIXME this opened window should be closed in sandbox.html
|
||||
closeWindow(openedWindow).then(done)
|
||||
})
|
||||
w.webContents.send('child-loaded')
|
||||
})
|
||||
})
|
||||
|
||||
app.once('browser-window-created', function (event, window) {
|
||||
openedWindow = window
|
||||
})
|
||||
})
|
||||
|
||||
it('should set ipc event sender correctly', function (done) {
|
||||
|
||||
Reference in New Issue
Block a user