File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change
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
+ } ) ) ;
You can’t perform that action at this time.
0 commit comments