From 0f7e43aa47e1586b468c38c17b266aa52fe912d3 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 29 Aug 2016 10:14:35 -0700 Subject: [PATCH] Re-enable DOM object over IPC asserts --- spec/api-browser-window-spec.js | 7 ++++--- spec/api-ipc-spec.js | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/spec/api-browser-window-spec.js b/spec/api-browser-window-spec.js index d6ac2846d..0c3e3f222 100644 --- a/spec/api-browser-window-spec.js +++ b/spec/api-browser-window-spec.js @@ -1255,9 +1255,10 @@ describe('browser-window module', function () { w.loadURL(server.url) }) - it('converts DOM objects to empty objects', function (done) { - w.webContents.executeJavaScript('document.location', function (result) { - assert.deepEqual(result, {}) + it('works with result objects that have DOM class prototypes', function (done) { + w.webContents.executeJavaScript('document.location', function (result) { + assert.equal(result.origin, server.url) + assert.equal(result.protocol, 'http:') done() }) w.loadURL(server.url) diff --git a/spec/api-ipc-spec.js b/spec/api-ipc-spec.js index ff08ae86f..20b1dad13 100644 --- a/spec/api-ipc-spec.js +++ b/spec/api-ipc-spec.js @@ -318,11 +318,12 @@ describe('ipc module', function () { ipcRenderer.send('message', buffer) }) - it('converts DOM objects to empty objects', function (done) { + it('can send objects with DOM class prototypes', function (done) { ipcRenderer.once('message', function (event, value) { - assert.deepEqual(value, {}) + assert.equal(value.protocol, 'file:') + assert.equal(value.hostname, '') done() - }) + }) ipcRenderer.send('message', document.location) })