diff --git a/spec/api-browser-window-spec.js b/spec/api-browser-window-spec.js index 98898c1eed92..7a71bb5f72c0 100644 --- a/spec/api-browser-window-spec.js +++ b/spec/api-browser-window-spec.js @@ -1095,19 +1095,30 @@ describe('BrowserWindow module', function () { }) }) it('opens window of about:blank with cross-scripting enabled', (done) => { - ipcMain.once('answer', function (event, content) { + ipcMain.once('answer', (event, content) => { assert.equal(content, 'Hello') done() }) w.loadURL('file://' + path.join(fixtures, 'api', 'native-window-open.html#blank')) }) it('opens window of same domain with cross-scripting enabled', (done) => { - ipcMain.once('answer', function (event, content) { + ipcMain.once('answer', (event, content) => { assert.equal(content, 'Hello') done() }) w.loadURL('file://' + path.join(fixtures, 'api', 'native-window-open.html#file')) }) + it('loads native addons correctly after reload', (done) => { + ipcMain.once('answer', (event, content) => { + assert.equal(content, 'function') + ipcMain.once('answer', (event, content) => { + assert.equal(content, 'function') + done() + }) + w.reload() + }) + w.loadURL('file://' + path.join(fixtures, 'api', 'native-window-open.html#native-addon')) + }) }) }) diff --git a/spec/fixtures/api/native-window-open.html b/spec/fixtures/api/native-window-open.html index 49c9352265e5..0d744fa678f9 100644 --- a/spec/fixtures/api/native-window-open.html +++ b/spec/fixtures/api/native-window-open.html @@ -15,6 +15,10 @@ const content = popup.document.querySelector('h1').innerText; ipcRenderer.send('answer', content); }; + }, + 'native-addon': () => { + const runas = require('runas'); + ipcRenderer.send('answer', typeof runas); } } const test = location.hash.slice(1);