test: de-flake getAllWebContents test by moving it to spec-main (#17610)

This commit is contained in:
Jeremy Apthorp 2019-04-01 18:28:11 -07:00 committed by GitHub
parent eb27e9b055
commit 7c6cedb119
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 55 additions and 22 deletions

View file

@ -141,28 +141,6 @@ describe('webContents module', () => {
})
})
describe('getAllWebContents() API', () => {
it('returns an array of web contents', (done) => {
w.webContents.on('devtools-opened', () => {
const all = webContents.getAllWebContents().sort((a, b) => {
return a.id - b.id
})
assert.ok(all.length >= 4)
assert.strictEqual(all[0].getType(), 'window')
assert.strictEqual(all[all.length - 2].getType(), 'webview')
assert.strictEqual(all[all.length - 1].getType(), 'remote')
done()
})
w.loadFile(path.join(fixtures, 'pages', 'webview-zoom-factor.html'))
w.webContents.on('did-attach-webview', () => {
w.webContents.openDevTools()
})
})
})
describe('getFocusedWebContents() API', () => {
it('returns the focused web contents', (done) => {
if (isCi) return done()