From d160be5daa674bfec3fffc32b2716a0f1c76b5f0 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 13 Jun 2016 09:05:04 -0700 Subject: [PATCH] Add web-contents-created event spec --- spec/api-app-spec.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/spec/api-app-spec.js b/spec/api-app-spec.js index 260bdd3..d2bda57 100644 --- a/spec/api-app-spec.js +++ b/spec/api-app-spec.js @@ -275,7 +275,18 @@ describe('app module', function () { w = new BrowserWindow({ 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 + }) }) }) }) -- 2.7.4