src: disable fast math on arm
[platform/upstream/nodejs.git] / test / parallel / test-http-agent-no-protocol.js
1 var common = require('../common');
2 var assert = require('assert');
3 var http = require('http');
4 var url = require('url');
5
6 var request = 0;
7 var response = 0;
8 process.on('exit', function() {
9   assert.equal(1, request, 'http server "request" callback was not called');
10   assert.equal(1, response, 'http client "response" callback was not called');
11 });
12
13 var server = http.createServer(function(req, res) {
14   res.end();
15   request++;
16 }).listen(common.PORT, '127.0.0.1', function() {
17   var opts = url.parse('http://127.0.0.1:' + common.PORT + '/');
18
19   // remove the `protocol` field… the `http` module should fall back
20   // to "http:", as defined by the global, default `http.Agent` instance.
21   opts.agent = new http.Agent();
22   opts.agent.protocol = null;
23
24   http.get(opts, function (res) {
25     response++;
26     res.resume();
27     server.close();
28   });
29 });