mirror of
https://github.com/nodejs/node.git
synced 2025-05-01 17:03:34 +00:00

This is a followup of https://github.com/nodejs/io.js/pull/2109. The tests which didn't make it in #2109, are included in this patch. The skip messages are supposed to follow the format 1..0 # Skipped: [Actual reason why the test is skipped] and the tests should be skipped with the return statement. PR-URL: https://github.com/nodejs/io.js/pull/2290 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
47 lines
1.1 KiB
JavaScript
47 lines
1.1 KiB
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
const cluster = require('cluster');
|
|
const http = require('http');
|
|
|
|
if (common.isWindows) {
|
|
console.log('1..0 # Skipped: It is not possible to send pipe handles over ' +
|
|
'the IPC pipe on Windows');
|
|
return;
|
|
}
|
|
|
|
if (cluster.isMaster) {
|
|
common.refreshTmpDir();
|
|
var ok = false;
|
|
var worker = cluster.fork();
|
|
worker.on('message', function(msg) {
|
|
assert.equal(msg, 'DONE');
|
|
ok = true;
|
|
});
|
|
worker.on('exit', function() {
|
|
process.exit();
|
|
});
|
|
process.on('exit', function() {
|
|
assert(ok);
|
|
});
|
|
return;
|
|
}
|
|
|
|
http.createServer(function(req, res) {
|
|
assert.equal(req.connection.remoteAddress, undefined);
|
|
assert.equal(req.connection.localAddress, undefined); // TODO common.PIPE?
|
|
res.writeHead(200);
|
|
res.end('OK');
|
|
}).listen(common.PIPE, function() {
|
|
var self = this;
|
|
http.get({ socketPath: common.PIPE, path: '/' }, function(res) {
|
|
res.resume();
|
|
res.on('end', function(err) {
|
|
if (err) throw err;
|
|
process.send('DONE');
|
|
process.exit();
|
|
});
|
|
});
|
|
});
|