| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent a4a5bee commit 4153938
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,30 @@ | |||
| 1 | + // Flags: --expose-http2 | ||
| 2 | + 'use strict'; | ||
| 3 | + | ||
| 4 | + const common = require('../common'); | ||
| 5 | + if (!common.hasCrypto) | ||
| 6 | + common.skip('missing crypto'); | ||
| 7 | + const assert = require('assert'); | ||
| 8 | + const http2 = require('http2'); | ||
| 9 | + | ||
| 10 | + const server = http2.createServer(); | ||
| 11 | + | ||
| 12 | + // Test blank return when a stream.session.shutdown is called twice | ||
| 13 | + // Also tests stream.session.shutdown with just a callback function (no options) | ||
| 14 | + server.on('stream', common.mustCall((stream) => { | ||
| 15 | + stream.session.shutdown(common.mustCall(() => { | ||
| 16 | + assert.strictEqual( | ||
| 17 | + stream.session.shutdown(common.mustNotCall()), | ||
| 18 | + undefined | ||
| 19 | + ); | ||
| 20 | + })); | ||
| 21 | + stream.session.shutdown(common.mustNotCall()); | ||
| 22 | + })); | ||
| 23 | + | ||
| 24 | + server.listen(0, common.mustCall(() => { | ||
| 25 | + const client = http2.connect(`http://localhost:${server.address().port}`); | ||
| 26 | + | ||
| 27 | + const req = client.request(); | ||
| 28 | + req.resume(); | ||
| 29 | + req.on('end', common.mustCall(() => server.close())); | ||
| 30 | + })); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments