diff options
author | Anatoli Papirovski <apapirovski@mac.com> | 2017-10-02 21:56:53 -0400 |
---|---|---|
committer | Matteo Collina <hello@matteocollina.com> | 2017-10-06 14:04:22 -0700 |
commit | 2da7d9b8207d9c35d199734da75fa2bb15f326b6 (patch) | |
tree | 9aa1ed51d29bc3d9241539e9ded4d0e4da951970 /test/parallel/test-http2-options-max-reserved-streams.js | |
parent | 4f339b54e9cd8a2cb69b41d87832ad8ca3a6b5e2 (diff) | |
download | android-node-v8-2da7d9b8207d9c35d199734da75fa2bb15f326b6.tar.gz android-node-v8-2da7d9b8207d9c35d199734da75fa2bb15f326b6.tar.bz2 android-node-v8-2da7d9b8207d9c35d199734da75fa2bb15f326b6.zip |
http2: near full http1 compatibility, add tests
Extensive re-work of http1 compatibility layer based on tests in
express, on-finished and finalhandler. Fix handling of HEAD
method to match http1. Adjust write, end, etc. to call writeHead
as in http1 and as expected by user-land modules. Add socket
proxy that instead uses the Http2Stream for the vast majority of
socket interactions. Add and change tests to closer represent
http1 behaviour.
Refs: https://github.com/nodejs/node/pull/15633
Refs: https://github.com/expressjs/express/tree/master/test
Refs: https://github.com/jshttp/on-finished/blob/master/test/test.js
Refs: https://github.com/pillarjs/finalhandler/blob/master/test/test.js
PR-URL: https://github.com/nodejs/node/pull/15702
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Diffstat (limited to 'test/parallel/test-http2-options-max-reserved-streams.js')
-rw-r--r-- | test/parallel/test-http2-options-max-reserved-streams.js | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/test/parallel/test-http2-options-max-reserved-streams.js b/test/parallel/test-http2-options-max-reserved-streams.js index 5e61907770..17009a4c11 100644 --- a/test/parallel/test-http2-options-max-reserved-streams.js +++ b/test/parallel/test-http2-options-max-reserved-streams.js @@ -3,6 +3,7 @@ const common = require('../common'); if (!common.hasCrypto) common.skip('missing crypto'); +const assert = require('assert'); const h2 = require('http2'); const server = h2.createServer(); @@ -32,11 +33,9 @@ server.on('stream', common.mustCall((stream) => { }, common.mustCall((pushedStream) => { pushedStream.respond({ ':status': 200 }); pushedStream.on('aborted', common.mustCall()); - pushedStream.on('error', common.mustCall(common.expectsError({ - code: 'ERR_HTTP2_STREAM_ERROR', - type: Error, - message: 'Stream closed with error code 8' - }))); + pushedStream.on('error', common.mustNotCall()); + pushedStream.on('streamClosed', + common.mustCall((code) => assert.strictEqual(code, 8))); })); stream.end('hello world'); |