mirror of https://github.com/lukechilds/node.git
Browse Source
Refs #14985 PR-URL: https://github.com/nodejs/node/pull/15758 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Minwoo Jung <minwoo@nodesource.com>v9.x-staging
Trivikram Kamat
7 years ago
committed by
James M Snell
2 changed files with 31 additions and 41 deletions
@ -1,30 +0,0 @@ |
|||||
'use strict'; |
|
||||
|
|
||||
const common = require('../common'); |
|
||||
if (!common.hasCrypto) |
|
||||
common.skip('missing crypto'); |
|
||||
const http2 = require('http2'); |
|
||||
|
|
||||
const server = http2.createServer(); |
|
||||
|
|
||||
// Test that ERR_HTTP2_INVALID_SESSION is thrown when a stream is destroyed
|
|
||||
// before calling stream.session.shutdown
|
|
||||
server.on('stream', common.mustCall((stream) => { |
|
||||
stream.session.destroy(); |
|
||||
common.expectsError( |
|
||||
() => stream.session.shutdown(), |
|
||||
{ |
|
||||
type: Error, |
|
||||
code: 'ERR_HTTP2_INVALID_SESSION', |
|
||||
message: 'The session has been destroyed' |
|
||||
} |
|
||||
); |
|
||||
})); |
|
||||
|
|
||||
server.listen(0, common.mustCall(() => { |
|
||||
const client = http2.connect(`http://localhost:${server.address().port}`); |
|
||||
|
|
||||
const req = client.request(); |
|
||||
req.resume(); |
|
||||
req.on('end', common.mustCall(() => server.close())); |
|
||||
})); |
|
Loading…
Reference in new issue