mirror of
https://github.com/electron/electron.git
synced 2026-01-26 07:48:08 -05:00
Add test for sending webContents instance over IPC
This commit is contained in:
@@ -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 () {})
|
||||
|
||||
Reference in New Issue
Block a user