diff --git a/spec/api-ipc-spec.js b/spec/api-ipc-spec.js index 4d368134469b..9cb3a4c5069b 100644 --- a/spec/api-ipc-spec.js +++ b/spec/api-ipc-spec.js @@ -517,4 +517,19 @@ describe('ipc module', function () { ipcRenderer.removeAllListeners('test-event') assert.equal(ipcRenderer.listenerCount('test-event'), 0) }) + + describe('remote objects registry', function () { + it('does not dereference until the render view is deleted (regression)', function (done) { + w = new BrowserWindow({ + show: true + }) + + ipcMain.once('error-message', (event, message) => { + assert(message.startsWith('Cannot call function \'getURL\' on missing remote object'), message) + done() + }) + + w.loadURL('file://' + path.join(fixtures, 'api', 'render-view-deleted.html')) + }) + }) }) diff --git a/spec/fixtures/api/render-view-deleted.html b/spec/fixtures/api/render-view-deleted.html new file mode 100644 index 000000000000..bfc281eb4298 --- /dev/null +++ b/spec/fixtures/api/render-view-deleted.html @@ -0,0 +1,32 @@ + + +
+ +