Allow returning file for custom protocol.

This commit is contained in:
Cheng Zhao 2013-08-25 16:06:29 +08:00
parent 1ed77371c0
commit 244d7eaf17
4 changed files with 40 additions and 1 deletions

View file

@ -13,9 +13,9 @@ describe 'protocol API', ->
it 'calls the callback when scheme is visited', (done) ->
protocol.registerProtocol 'test2', (url) ->
assert.equal url, 'test2://test2'
protocol.unregisterProtocol 'test2'
done()
$.get 'test2://test2', ->
protocol.unregisterProtocol 'test2'
describe 'protocol.unregisterProtocol', ->
it 'throws error when scheme does not exist', ->
@ -40,3 +40,12 @@ describe 'protocol API', ->
done()
error: (xhr, errorType, error) ->
assert false, 'Got error: ' + errorType + ' ' + error
it 'returns RequestFileJob should send file', (done) ->
$.ajax
url: 'atom-file-job://' + __filename
success: (data) ->
console.log data
done()
error: (xhr, errorType, error) ->
assert false, 'Got error: ' + errorType + ' ' + error