support https, ws, wss builtin schemes to be intercepted

This commit is contained in:
deepak1556 2015-05-11 12:56:36 +05:30
parent 7fee639edf
commit 707503ac40
4 changed files with 37 additions and 4 deletions

View file

@ -197,3 +197,24 @@ describe 'protocol module', ->
protocol.uninterceptProtocol 'http'
done()
protocol.interceptProtocol 'http', handler
it 'can override https protocol handler', (done) ->
handler = remote.createFunctionWithReturnValue 'valar morghulis'
protocol.once 'intercepted', ->
protocol.uninterceptProtocol 'https'
done()
protocol.interceptProtocol 'https', handler
it 'can override ws protocol handler', (done) ->
handler = remote.createFunctionWithReturnValue 'valar morghulis'
protocol.once 'intercepted', ->
protocol.uninterceptProtocol 'ws'
done()
protocol.interceptProtocol 'ws', handler
it 'can override wss protocol handler', (done) ->
handler = remote.createFunctionWithReturnValue 'valar morghulis'
protocol.once 'intercepted', ->
protocol.uninterceptProtocol 'wss'
done()
protocol.interceptProtocol 'wss', handler