]> khamidou — GitHub mirrors - electron.git/commitdiff
Add spec for protocol.isHandledProtocol.
authorCheng Zhao <zcbenz@gmail.com>
Thu, 29 Aug 2013 12:57:09 +0000 (20:57 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Thu, 29 Aug 2013 12:57:09 +0000 (20:57 +0800)
spec/api/protocol.coffee

index 0a947aba62e934afbb10029cf716885efa02d177..8d37431523a8522c8aeaff266341bfe3a5cc4fd9 100644 (file)
@@ -70,3 +70,10 @@ describe 'protocol API', ->
         error: (xhr, errorType, error) ->
           assert false, 'Got error: ' + errorType + ' ' + error
           protocol.unregisterProtocol 'atom-file-job'
+
+  describe 'protocol.isHandledProtocol', ->
+    it 'returns true if the scheme can be handled', (done) ->
+      assert.equal protocol.isHandledProtocol('file'), true
+      assert.equal protocol.isHandledProtocol('http'), true
+      assert.equal protocol.isHandledProtocol('https'), true
+      assert.equal protocol.isHandledProtocol('atom'), false