mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Update api-browser-window-spec.js
This commit is contained in:
@@ -1273,8 +1273,12 @@ describe('BrowserWindow module', function () {
|
||||
const initialWebContents = webContents.getAllWebContents().map((i) => i.id)
|
||||
ipcRenderer.send('prevent-next-new-window', w.webContents.id)
|
||||
w.webContents.once('new-window', () => {
|
||||
assert.deepEqual(webContents.getAllWebContents().map((i) => i.id), initialWebContents)
|
||||
done()
|
||||
// We need to give it some time so the windows get properly disposed (at least on OSX).
|
||||
setTimeout(() => {
|
||||
const currentWebContents = webContents.getAllWebContents().map((i) => i.id)
|
||||
assert.deepEqual(currentWebContents, initialWebContents)
|
||||
done()
|
||||
}, 100);
|
||||
})
|
||||
w.loadURL('file://' + path.join(fixtures, 'pages', 'window-open.html'))
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user