From 690ca7ec2aa31c2897ad53cd7ddd998258944680 Mon Sep 17 00:00:00 2001 From: gellert Date: Sun, 31 Jul 2016 22:06:34 +0200 Subject: [PATCH] filtering out offscreen webcontents in getAllWebcontents call --- spec/api-web-contents-spec.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/spec/api-web-contents-spec.js b/spec/api-web-contents-spec.js index 90203410a161..0c9823bb536e 100644 --- a/spec/api-web-contents-spec.js +++ b/spec/api-web-contents-spec.js @@ -38,14 +38,13 @@ describe('webContents module', function () { w.webContents.on('devtools-opened', function () { const all = webContents.getAllWebContents().sort(function (a, b) { return a.getId() - b.getId() - }) + }).filter(function (wc) { return wc.getType() !== 'offscreen' }) - assert.equal(all.length, 5) + assert.equal(all.length, 4) assert.equal(all[0].getType(), 'window') - assert.equal(all[1].getType(), 'offscreen') - assert.equal(all[2].getType(), 'window') - assert.equal(all[3].getType(), 'remote') - assert.equal(all[4].getType(), 'webview') + assert.equal(all[1].getType(), 'window') + assert.equal(all[2].getType(), 'remote') + assert.equal(all[3].getType(), 'webview') done() })