Make sure referrer is sent to the protocol handler.

This commit is contained in:
Cheng Zhao 2013-08-27 11:37:06 +08:00
parent 15ba32b489
commit 799d9ada7d
2 changed files with 3 additions and 1 deletions

View file

@ -12,8 +12,9 @@ describe 'protocol API', ->
protocol.unregisterProtocol 'test1'
it 'calls the callback when scheme is visited', (done) ->
protocol.registerProtocol 'test2', (url) ->
protocol.registerProtocol 'test2', (url, referrer) ->
assert.equal url, 'test2://test2'
assert.equal referrer, window.location.toString()
protocol.unregisterProtocol 'test2'
done()
$.get 'test2://test2', ->