test: actually test sandbox events in the test that says 'test sandbox events' (#19284)
This commit is contained in:
parent
b5f69e0b9f
commit
c5e249b85c
2 changed files with 9 additions and 8 deletions
8
spec/fixtures/api/sandbox.html
vendored
8
spec/fixtures/api/sandbox.html
vendored
|
@ -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')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue