filtering out offscreen webcontents in getAllWebcontents call
This commit is contained in:
parent
1cd1c5e01c
commit
690ca7ec2a
1 changed files with 5 additions and 6 deletions
|
@ -38,14 +38,13 @@ describe('webContents module', function () {
|
||||||
w.webContents.on('devtools-opened', function () {
|
w.webContents.on('devtools-opened', function () {
|
||||||
const all = webContents.getAllWebContents().sort(function (a, b) {
|
const all = webContents.getAllWebContents().sort(function (a, b) {
|
||||||
return a.getId() - b.getId()
|
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[0].getType(), 'window')
|
||||||
assert.equal(all[1].getType(), 'offscreen')
|
assert.equal(all[1].getType(), 'window')
|
||||||
assert.equal(all[2].getType(), 'window')
|
assert.equal(all[2].getType(), 'remote')
|
||||||
assert.equal(all[3].getType(), 'remote')
|
assert.equal(all[3].getType(), 'webview')
|
||||||
assert.equal(all[4].getType(), 'webview')
|
|
||||||
|
|
||||||
done()
|
done()
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue