refactor: use loadFile when appropriate in tests (#14422)

This commit is contained in:
Milan Burda 2018-09-04 16:50:53 +02:00 committed by Charles Kerr
parent e8782f2c2d
commit c63014c256
13 changed files with 115 additions and 137 deletions

View file

@ -154,7 +154,7 @@ describe('ipc renderer module', () => {
ipcRenderer.sendTo(contents.id, 'ping', payload)
})
contents.loadURL(`file://${path.join(fixtures, 'pages', 'ping-pong.html')}`)
contents.loadFile(path.join(fixtures, 'pages', 'ping-pong.html'))
})
it('sends message to WebContents (sanboxed renderer)', done => {
@ -174,7 +174,7 @@ describe('ipc renderer module', () => {
ipcRenderer.sendTo(contents.id, 'ping', payload)
})
contents.loadURL(`file://${path.join(fixtures, 'pages', 'ping-pong.html')}`)
contents.loadFile(path.join(fixtures, 'pages', 'ping-pong.html'))
})
it('sends message to WebContents (channel has special chars)', done => {
@ -193,7 +193,7 @@ describe('ipc renderer module', () => {
ipcRenderer.sendTo(contents.id, 'ping-æøåü', payload)
})
contents.loadURL(`file://${path.join(fixtures, 'pages', 'ping-pong.html')}`)
contents.loadFile(path.join(fixtures, 'pages', 'ping-pong.html'))
})
})
@ -221,7 +221,7 @@ describe('ipc renderer module', () => {
w.webContents.reload()
})
w.loadURL(`file://${path.join(fixtures, 'api', 'remote-event-handler.html')}`)
w.loadFile(path.join(fixtures, 'api', 'remote-event-handler.html'))
})
})