Add some tests for "sandbox" option

This commit is contained in:
Thiago de Arruda 2016-09-26 17:40:45 -03:00
parent a64978b812
commit 47fd41715f
3 changed files with 282 additions and 0 deletions

13
spec/fixtures/module/preload-sandbox.js vendored Normal file
View file

@ -0,0 +1,13 @@
(function () {
const {ipcRenderer} = require('electron')
window.ipcRenderer = ipcRenderer
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)
}
})()