spec: node symbols should always be available in preload script
This commit is contained in:
parent
3bd16a5ecd
commit
baacc939f6
2 changed files with 15 additions and 0 deletions
7
spec/fixtures/module/preload-node-off.js
vendored
Normal file
7
spec/fixtures/module/preload-node-off.js
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
setImmediate(function() {
|
||||
try {
|
||||
console.log([typeof process, typeof setImmediate, typeof global].join(' '));
|
||||
} catch (e) {
|
||||
console.log(e.message);
|
||||
}
|
||||
});
|
|
@ -84,6 +84,14 @@ describe '<webview> tag', ->
|
|||
webview.src = "file://#{fixtures}/pages/e.html"
|
||||
document.body.appendChild webview
|
||||
|
||||
it 'preload script can still use "process" in required modules when nodeintegration is off', (done) ->
|
||||
webview.addEventListener 'console-message', (e) ->
|
||||
assert.equal e.message, 'object function object'
|
||||
done()
|
||||
webview.setAttribute 'preload', "#{fixtures}/module/preload-node-off.js"
|
||||
webview.src = "file://#{fixtures}/api/blank.html"
|
||||
document.body.appendChild webview
|
||||
|
||||
it 'receives ipc message in preload script', (done) ->
|
||||
message = 'boom!'
|
||||
listener = (e) ->
|
||||
|
|
Loading…
Reference in a new issue