mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
test: actually test sandbox events in the test that says 'test sandbox events' (#19284)
This commit is contained in:
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')
|
||||
|
||||
Reference in New Issue
Block a user