feat: webContents.loadURL returns a promise (#15855)

This commit is contained in:
Jeremy Apthorp 2018-12-06 12:16:19 -08:00 committed by GitHub
parent 1b8c11121f
commit 442c1b22e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 180 additions and 13 deletions

View file

@ -5,7 +5,6 @@ const dirtyChai = require('dirty-chai')
const http = require('http')
const path = require('path')
const { closeWindow } = require('./window-helpers')
const { emittedOnce } = require('./events-helpers')
const { expect } = chai
chai.use(dirtyChai)
@ -229,9 +228,7 @@ describe('ipc renderer module', () => {
describe('ipcRenderer.on', () => {
it('is not used for internals', async () => {
w = new BrowserWindow({ show: false })
w.loadURL('about:blank')
await emittedOnce(w.webContents, 'did-finish-load')
await w.loadURL('about:blank')
const script = `require('electron').ipcRenderer.eventNames()`
const result = await w.webContents.executeJavaScript(script)