diff --git a/spec/api-browser-window-spec.js b/spec/api-browser-window-spec.js index 5bb18833ed..5d23170ede 100644 --- a/spec/api-browser-window-spec.js +++ b/spec/api-browser-window-spec.js @@ -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, '

http://www.google.com/#q=electron

') 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) {