From 434e7cb5e94469674e793d2d7281c20c53d7bbe4 Mon Sep 17 00:00:00 2001
From: Kevin Sawicki <kevinsawicki@gmail.com>
Date: Mon, 29 Aug 2016 10:21:30 -0700
Subject: [PATCH] Add test for sending webContents instance over IPC

---
 spec/api-ipc-spec.js | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/spec/api-ipc-spec.js b/spec/api-ipc-spec.js
index 20b1dad13..dda32c0a8 100644
--- a/spec/api-ipc-spec.js
+++ b/spec/api-ipc-spec.js
@@ -327,6 +327,15 @@ describe('ipc module', function () {
       ipcRenderer.send('message', document.location)
     })
 
+    it('can send Electron API objects', function (done) {
+      const webContents = remote.getCurrentWebContents()
+      ipcRenderer.once('message', function (event, value) {
+        assert.deepEqual(value.browserWindowOptions, webContents.browserWindowOptions)
+        done()
+       })
+      ipcRenderer.send('message', webContents)
+    })
+
     it('does not crash on HTTP request objects (regression)', function (done) {
       const request = http.request({port: 5000, hostname: '127.0.0.1', method: 'GET', path: '/'})
       request.on('error', function () {})