]> khamidou — GitHub mirrors - electron.git/commitdiff
Do not rely on external server in spec.
authorCheng Zhao <zcbenz@gmail.com>
Thu, 8 May 2014 01:20:01 +0000 (09:20 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Thu, 8 May 2014 01:20:01 +0000 (09:20 +0800)
spec/chromium-spec.coffee

index efbd7da0a25519663add09ce82db3c938df49a86..1454c23ae649f6e233a63bae5ff2a6fd266126f7 100644 (file)
@@ -1,4 +1,5 @@
 assert = require 'assert'
+http = require 'http'
 path = require 'path'
 
 describe 'chromium feature', ->
@@ -9,9 +10,15 @@ describe 'chromium feature', ->
       process.atomBinding('v8_util').takeHeapSnapshot()
 
   describe 'sending request of http protocol urls', ->
-    it 'does not crash', ->
+    it 'does not crash', (done) ->
       @timeout 5000
-      $.get 'https://api.github.com/zen'
+      server = http.createServer (req, res) ->
+        res.end()
+        server.close()
+        done()
+      server.listen 0, '127.0.0.1', ->
+        {port} = server.address()
+        $.get "http://127.0.0.1:#{port}"
 
   describe 'navigator.webkitGetUserMedia', ->
     it 'calls its callbacks', (done) ->