diff options
author | James M Snell <jasnell@gmail.com> | 2017-11-21 17:09:32 -0800 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2017-11-24 12:20:05 -0800 |
commit | 9d87082d7df8b509d3e035b0222899d9cd8e58a3 (patch) | |
tree | b45a62c0c3673d802d99efd4c95212ddd106420d /test | |
parent | 9ec78101fad90e6469677598b6bc3e8196d1b17f (diff) | |
download | android-node-v8-9d87082d7df8b509d3e035b0222899d9cd8e58a3.tar.gz android-node-v8-9d87082d7df8b509d3e035b0222899d9cd8e58a3.tar.bz2 android-node-v8-9d87082d7df8b509d3e035b0222899d9cd8e58a3.zip |
http2: general cleanups in core.js
* fixup js debug messages
* simplify and improve rstStream
* improve and simplify _read
* simplify and improve priority
* simplify on ready a bit
* simplify and improve respond/push
* reduce duplication with _unrefActive
* simplify stream close handling
PR-URL: https://github.com/nodejs/node/pull/17209
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/parallel/test-http2-priority-parent-self.js | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/test/parallel/test-http2-priority-parent-self.js b/test/parallel/test-http2-priority-parent-self.js deleted file mode 100644 index 55a161bf17..0000000000 --- a/test/parallel/test-http2-priority-parent-self.js +++ /dev/null @@ -1,57 +0,0 @@ -'use strict'; - -const common = require('../common'); -if (!common.hasCrypto) - common.skip('missing crypto'); -const h2 = require('http2'); - -const server = h2.createServer(); -const invalidOptValueError = (value) => ({ - type: TypeError, - code: 'ERR_INVALID_OPT_VALUE', - message: `The value "${value}" is invalid for option "parent"` -}); - -// we use the lower-level API here -server.on('stream', common.mustCall((stream) => { - common.expectsError( - () => stream.priority({ - parent: stream.id, - weight: 1, - exclusive: false - }), - invalidOptValueError(stream.id) - ); - stream.respond({ - 'content-type': 'text/html', - ':status': 200 - }); - stream.end('hello world'); -})); - -server.listen(0, common.mustCall(() => { - - const client = h2.connect(`http://localhost:${server.address().port}`); - const req = client.request({ ':path': '/' }); - - req.on( - 'ready', - () => common.expectsError( - () => req.priority({ - parent: req.id, - weight: 1, - exclusive: false - }), - invalidOptValueError(req.id) - ) - ); - - req.on('response', common.mustCall()); - req.resume(); - req.on('end', common.mustCall(() => { - server.close(); - client.destroy(); - })); - req.end(); - -})); |