Test external value as send argument
This commit is contained in:
parent
8a9776b227
commit
3e7a0e4b43
1 changed files with 7 additions and 4 deletions
|
@ -338,13 +338,16 @@ describe('ipc module', function () {
|
||||||
|
|
||||||
it('does not crash on external objects (regression)', function (done) {
|
it('does not crash on external objects (regression)', function (done) {
|
||||||
const request = http.request({port: 5000, hostname: '127.0.0.1', method: 'GET', path: '/'})
|
const request = http.request({port: 5000, hostname: '127.0.0.1', method: 'GET', path: '/'})
|
||||||
|
const stream = request.agent.sockets['127.0.0.1:5000:'][0]._handle._externalStream
|
||||||
request.on('error', function () {})
|
request.on('error', function () {})
|
||||||
ipcRenderer.once('message', function (event, value) {
|
ipcRenderer.once('message', function (event, requestValue, externalStreamValue) {
|
||||||
assert.equal(value.method, 'GET')
|
assert.equal(requestValue.method, 'GET')
|
||||||
assert.equal(value.path, '/')
|
assert.equal(requestValue.path, '/')
|
||||||
|
assert.equal(externalStreamValue, null)
|
||||||
done()
|
done()
|
||||||
})
|
})
|
||||||
ipcRenderer.send('message', request)
|
|
||||||
|
ipcRenderer.send('message', request, stream)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('can send objects that both reference the same object', function (done) {
|
it('can send objects that both reference the same object', function (done) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue