Call the JS handler to get the type of job.
This commit is contained in:
parent
214df5ef69
commit
8cd7ccdc0d
3 changed files with 39 additions and 13 deletions
|
@ -4,12 +4,17 @@ protocol = require('remote').require 'protocol'
|
|||
describe 'protocol API', ->
|
||||
describe 'protocol.registerProtocol', ->
|
||||
it 'throws error when scheme is already registered', ->
|
||||
register = -> protocol.registerProtocol('test', ->)
|
||||
register = -> protocol.registerProtocol('test1', ->)
|
||||
register()
|
||||
assert.throws register, /The scheme is already registered/
|
||||
protocol.unregisterProtocol 'test'
|
||||
protocol.unregisterProtocol 'test1'
|
||||
|
||||
it 'calls the callback when scheme is visited', (done) ->
|
||||
protocol.registerProtocol 'test2', -> done()
|
||||
$.get 'test2://test2', ->
|
||||
protocol.unregisterProtocol 'test2'
|
||||
|
||||
describe 'protocol.unregisterProtocol', ->
|
||||
it 'throws error when scheme does not exist', ->
|
||||
unregister = -> protocol.unregisterProtocol 'test'
|
||||
unregister = -> protocol.unregisterProtocol 'test3'
|
||||
assert.throws unregister, /The scheme has not been registered/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue