test: guarantee the order of webview and devtools creation (#14849)

This commit is contained in:
Samuel Attard 2018-09-29 05:34:57 +10:00 committed by Shelley Vohr
parent 78239ff0ad
commit b42493e6e6

View file

@ -46,14 +46,16 @@ describe('webContents module', () => {
assert.ok(all.length >= 4) assert.ok(all.length >= 4)
assert.strictEqual(all[0].getType(), 'window') assert.strictEqual(all[0].getType(), 'window')
assert.strictEqual(all[all.length - 2].getType(), 'remote') assert.strictEqual(all[all.length - 2].getType(), 'webview')
assert.strictEqual(all[all.length - 1].getType(), 'webview') assert.strictEqual(all[all.length - 1].getType(), 'remote')
done() done()
}) })
w.loadFile(path.join(fixtures, 'pages', 'webview-zoom-factor.html')) w.loadFile(path.join(fixtures, 'pages', 'webview-zoom-factor.html'))
w.webContents.openDevTools() w.webContents.on('did-attach-webview', () => {
w.webContents.openDevTools()
})
}) })
}) })