Add web-contents-created event spec

This commit is contained in:
Kevin Sawicki 2016-06-13 09:05:04 -07:00
parent 88a81ef946
commit d160be5daa

View file

@ -275,7 +275,18 @@ describe('app module', function () {
w = new BrowserWindow({ w = new BrowserWindow({
show: false show: false
}) })
w.emit('blur') })
it('should emit web-contents-created event when a webContents is created', function (done) {
app.once('web-contents-created', function (e, webContents) {
setImmediate(function () {
assert.equal(w.webContents.id, webContents.id)
done()
})
})
w = new BrowserWindow({
show: false
})
}) })
}) })
}) })