diff --git a/spec/api-browser-window-spec.js b/spec/api-browser-window-spec.js index 81d512212c39..354befdb3f4b 100644 --- a/spec/api-browser-window-spec.js +++ b/spec/api-browser-window-spec.js @@ -801,8 +801,9 @@ describe('BrowserWindow module', function () { describe('"node-integration" option', function () { it('disables node integration when specified to false', function (done) { var preload = path.join(fixtures, 'module', 'send-later.js') - ipcMain.once('answer', function (event, test) { - assert.equal(test, 'undefined') + ipcMain.once('answer', function (event, typeofProcess, typeofBuffer) { + assert.equal(typeofProcess, 'undefined') + assert.equal(typeofBuffer, 'undefined') done() }) w.destroy() diff --git a/spec/fixtures/module/preload-node-off.js b/spec/fixtures/module/preload-node-off.js index 54fe343a9ca0..452ee41b68b3 100644 --- a/spec/fixtures/module/preload-node-off.js +++ b/spec/fixtures/module/preload-node-off.js @@ -1,6 +1,6 @@ setImmediate(function () { try { - console.log([typeof process, typeof setImmediate, typeof global].join(' ')) + console.log([typeof process, typeof setImmediate, typeof global, typeof Buffer].join(' ')) } catch (e) { console.log(e.message) } diff --git a/spec/fixtures/module/preload.js b/spec/fixtures/module/preload.js index 39c8b11fbe38..e9dad8ac99bb 100644 --- a/spec/fixtures/module/preload.js +++ b/spec/fixtures/module/preload.js @@ -1 +1 @@ -console.log([typeof require, typeof module, typeof process].join(' ')) +console.log([typeof require, typeof module, typeof process, typeof Buffer].join(' ')) diff --git a/spec/fixtures/module/send-later.js b/spec/fixtures/module/send-later.js index 8eb16f72f8cc..2d3156faaa7d 100644 --- a/spec/fixtures/module/send-later.js +++ b/spec/fixtures/module/send-later.js @@ -1,4 +1,4 @@ var ipcRenderer = require('electron').ipcRenderer window.onload = function () { - ipcRenderer.send('answer', typeof window.process) + ipcRenderer.send('answer', typeof window.process, typeof window.Buffer) } diff --git a/spec/webview-spec.js b/spec/webview-spec.js index 02207a4b26a4..39d10f15269c 100644 --- a/spec/webview-spec.js +++ b/spec/webview-spec.js @@ -171,7 +171,7 @@ describe(' tag', function () { describe('preload attribute', function () { it('loads the script before other scripts in window', function (done) { var listener = function (e) { - assert.equal(e.message, 'function object object') + assert.equal(e.message, 'function object object function') webview.removeEventListener('console-message', listener) done() } @@ -181,9 +181,9 @@ describe(' tag', function () { document.body.appendChild(webview) }) - it('preload script can still use "process" in required modules when nodeintegration is off', function (done) { + it('preload script can still use "process" and "Buffer" in required modules when nodeintegration is off', function (done) { webview.addEventListener('console-message', function (e) { - assert.equal(e.message, 'object undefined object') + assert.equal(e.message, 'object undefined object function') done() }) webview.setAttribute('preload', fixtures + '/module/preload-node-off.js') @@ -212,7 +212,7 @@ describe(' tag', function () { it('works without script tag in page', function (done) { var listener = function (e) { - assert.equal(e.message, 'function object object') + assert.equal(e.message, 'function object object function') webview.removeEventListener('console-message', listener) done() } @@ -224,7 +224,7 @@ describe(' tag', function () { it('resolves relative URLs', function (done) { var listener = function (e) { - assert.equal(e.message, 'function object object') + assert.equal(e.message, 'function object object function') webview.removeEventListener('console-message', listener) done() }