test: de-flake getAllWebContents test by moving it to spec-main (#17610)
This commit is contained in:
parent
eb27e9b055
commit
7c6cedb119
2 changed files with 55 additions and 22 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue