chore: refactor context isolation spec (#14394)
* spec: refactor BrowserWindow module contextIsolation option * spec: check for serialzation in isolated renderers separately
This commit is contained in:
parent
3a79eacb6f
commit
32158ca5dd
5 changed files with 63 additions and 59 deletions
18
spec/fixtures/api/isolated-preload.js
vendored
18
spec/fixtures/api/isolated-preload.js
vendored
|
@ -1,7 +1,3 @@
|
|||
// Ensure fetch works from isolated world origin
|
||||
fetch('http://localhost:1234')
|
||||
fetch('https://localhost:1234')
|
||||
|
||||
const {ipcRenderer, webFrame} = require('electron')
|
||||
|
||||
window.foo = 3
|
||||
|
@ -16,18 +12,8 @@ window.addEventListener('message', (event) => {
|
|||
typeofRequire: typeof require,
|
||||
typeofProcess: typeof process,
|
||||
typeofArrayPush: typeof Array.prototype.push,
|
||||
typeofFunctionApply: typeof Function.prototype.apply
|
||||
},
|
||||
pageContext: event.data
|
||||
})
|
||||
ipcRenderer.send('isolated-sandbox-world', {
|
||||
preloadContext: {
|
||||
preloadProperty: typeof window.foo,
|
||||
pageProperty: typeof window.hello,
|
||||
typeofRequire: typeof require,
|
||||
typeofProcess: typeof process,
|
||||
typeofArrayPush: typeof Array.prototype.push,
|
||||
typeofFunctionApply: typeof Function.prototype.apply
|
||||
typeofFunctionApply: typeof Function.prototype.apply,
|
||||
typeofPreloadExecuteJavaScriptProperty: typeof window.preloadExecuteJavaScriptProperty
|
||||
},
|
||||
pageContext: event.data
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue