From: Cheng Zhao Date: Thu, 8 May 2014 01:20:01 +0000 (+0800) Subject: Do not rely on external server in spec. X-Git-Tag: v0.12.4~16 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=ed744bf1d213d733a64a13af4d56db953ad80188;p=electron.git Do not rely on external server in spec. --- diff --git a/spec/chromium-spec.coffee b/spec/chromium-spec.coffee index efbd7da0..1454c23a 100644 --- a/spec/chromium-spec.coffee +++ b/spec/chromium-spec.coffee @@ -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) ->