5ee6205c0a
- Create a function that accepts BrowserWindow options and generates a suite that contains the renderer-specific tests. - Run the function twice to execute the tests with and without sandbox option.
15 lines
506 B
JavaScript
15 lines
506 B
JavaScript
(function () {
|
|
const {setImmediate} = require('timers')
|
|
const {ipcRenderer} = require('electron')
|
|
window.ipcRenderer = ipcRenderer
|
|
window.setImmediate = setImmediate
|
|
if (location.protocol === 'file:') {
|
|
window.test = 'preload'
|
|
window.require = require
|
|
window.process = process
|
|
} else if (location.href !== 'about:blank') {
|
|
addEventListener('DOMContentLoaded', () => {
|
|
ipcRenderer.send('child-loaded', window.opener == null, document.body.innerHTML)
|
|
}, false)
|
|
}
|
|
})()
|