diff options
author | Matteo Collina <hello@matteocollina.com> | 2019-09-26 11:23:45 +0200 |
---|---|---|
committer | Matteo Collina <hello@matteocollina.com> | 2019-10-10 10:34:12 +0200 |
commit | 9f873b3a659e82eb232785c9e7cfec6df8dd5277 (patch) | |
tree | c1f40c9e4929a58c2e5f218a647b276e18a16f83 /test/parallel/test-http-client-finished.js | |
parent | 8c606851056a1bb38abdcf7ab15df8ae35ba0cf9 (diff) | |
download | android-node-v8-9f873b3a659e82eb232785c9e7cfec6df8dd5277.tar.gz android-node-v8-9f873b3a659e82eb232785c9e7cfec6df8dd5277.tar.bz2 android-node-v8-9f873b3a659e82eb232785c9e7cfec6df8dd5277.zip |
Revert "stream: make finished call the callback if the stream is closed"
This reverts commit b03845b9376aec590b89f753a4b7c1b47729c5f8.
PR-URL: https://github.com/nodejs/node/pull/29717
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
Diffstat (limited to 'test/parallel/test-http-client-finished.js')
-rw-r--r-- | test/parallel/test-http-client-finished.js | 106 |
1 files changed, 0 insertions, 106 deletions
diff --git a/test/parallel/test-http-client-finished.js b/test/parallel/test-http-client-finished.js index 337f7b596d..2d7e5b95b3 100644 --- a/test/parallel/test-http-client-finished.js +++ b/test/parallel/test-http-client-finished.js @@ -25,109 +25,3 @@ const { finished } = require('stream'); .end(); })); } - -{ - // Test abort before finished. - - const server = http.createServer(function(req, res) { - }); - - server.listen(0, common.mustCall(function() { - const req = http.request({ - port: this.address().port - }, common.mustNotCall()); - req.abort(); - finished(req, common.mustCall(() => { - server.close(); - })); - })); -} - -{ - // Test abort after request. - - const server = http.createServer(function(req, res) { - }); - - server.listen(0, common.mustCall(function() { - const req = http.request({ - port: this.address().port - }).end(); - finished(req, (err) => { - common.expectsError({ - type: Error, - code: 'ERR_STREAM_PREMATURE_CLOSE' - })(err); - finished(req, common.mustCall(() => { - server.close(); - })); - }); - req.abort(); - })); -} - -{ - // Test abort before end. - - const server = http.createServer(function(req, res) { - res.write('test'); - }); - - server.listen(0, common.mustCall(function() { - const req = http.request({ - port: this.address().port - }).on('response', common.mustCall((res) => { - req.abort(); - finished(res, common.mustCall(() => { - finished(res, common.mustCall(() => { - server.close(); - })); - })); - })).end(); - })); -} - -{ - // Test destroy before end. - - const server = http.createServer(function(req, res) { - res.write('test'); - }); - - server.listen(0, common.mustCall(function() { - http.request({ - port: this.address().port - }).on('response', common.mustCall((res) => { - // TODO(ronag): Bug? Won't emit 'close' unless read. - res.on('data', () => {}); - res.destroy(); - finished(res, common.mustCall(() => { - finished(res, common.mustCall(() => { - server.close(); - })); - })); - })).end(); - })); -} - -{ - // Test finish after end. - - const server = http.createServer(function(req, res) { - res.end('asd'); - }); - - server.listen(0, common.mustCall(function() { - http.request({ - port: this.address().port - }).on('response', common.mustCall((res) => { - // TODO(ronag): Bug? Won't emit 'close' unless read. - res.on('data', () => {}); - finished(res, common.mustCall(() => { - finished(res, common.mustCall(() => { - server.close(); - })); - })); - })).end(); - })); -} |