test: actually test sandbox events in the test that says 'test sandbox events' (#19284)

This commit is contained in:
Jeremy Apthorp 2019-07-16 13:43:23 -07:00 committed by GitHub
parent b5f69e0b9f
commit c5e249b85c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 8 deletions

View file

@ -20,12 +20,12 @@
opener.require('electron').ipcRenderer.send('answer', document.body.innerHTML)
}
} else {
const {ipcRenderer, remote} = require('electron')
const tests = {
'reload-remote-child': () => {
open(`${location.protocol}//${location.pathname}?reload-remote`)
},
'reload-remote': async () => {
const {ipcRenderer, remote} = require('electron')
const p = ipcRenderer.sendSync('get-remote-module-path')
const Hello = remote.require(p)
if (!ipcRenderer.sendSync('reloaded')) {
@ -35,9 +35,6 @@
await invokeGc()
ipcRenderer.send('answer', new Hello().say())
},
'window-events': () => {
document.title = 'changed'
},
'webcontents-stop': () => {
stop()
},
@ -50,6 +47,7 @@
})
},
'exit-event': () => {
const {ipcRenderer} = require('electron')
process.on('exit', () => {
ipcRenderer.send('answer', location.href)
})
@ -65,6 +63,7 @@
})
},
'window-open-external': () => {
const {ipcRenderer} = require('electron')
addEventListener('load', () => {
ipcRenderer.once('open-the-popup', (event, url) => {
popup = open(url, '', 'top=65,left=55,width=505,height=605')
@ -82,6 +81,7 @@
})
},
'verify-ipc-sender': () => {
const {ipcRenderer} = require('electron')
popup = open()
ipcRenderer.once('verified', () => {
ipcRenderer.send('parent-answer')