test: move some fixtures from spec/ to spec-main/ (#21403)

This commit is contained in:
Jeremy Apthorp 2020-01-09 11:50:56 -08:00 committed by GitHub
parent 8a92b65fd3
commit 768a6ace1b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
44 changed files with 27 additions and 32 deletions

View file

@ -0,0 +1,14 @@
const { ipcRenderer, webFrame } = require('electron')
if (process.isMainFrame) {
// https://github.com/electron/electron/issues/17252
ipcRenderer.on('executeJavaScriptInFrame', (event, frameRoutingId, code, responseId) => {
const frame = webFrame.findFrameByRoutingId(frameRoutingId)
if (!frame) {
throw new Error(`Can't find frame for routing ID ${frameRoutingId}`)
}
frame.executeJavaScript(code, false).then(result => {
event.sender.send(`executeJavaScriptInFrame_${responseId}`, result)
})
})
}