File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -245,3 +245,45 @@ func TestPeerConnection_CloseWithIncomingMessages(t *testing.T) {
245
245
t .Fatal (err )
246
246
}
247
247
}
248
+
249
+ func TestPeerConnection_GracefulCloseWhileOpening (t * testing.T ) {
250
+ // Limit runtime in case of deadlocks
251
+ lim := test .TimeOut (time .Second * 5 )
252
+ defer lim .Stop ()
253
+
254
+ report := test .CheckRoutinesStrict (t )
255
+ defer report ()
256
+
257
+ pcOffer , pcAnswer , err := newPair ()
258
+ if err != nil {
259
+ t .Fatal (err )
260
+ }
261
+
262
+ if _ , err := pcOffer .CreateDataChannel ("initial_data_channel" , nil ); err != nil {
263
+ t .Fatal (err )
264
+ }
265
+
266
+ offer , err := pcOffer .CreateOffer (nil )
267
+ if err != nil {
268
+ t .Fatal (err )
269
+ }
270
+ offerGatheringComplete := GatheringCompletePromise (pcOffer )
271
+ if err = pcOffer .SetLocalDescription (offer ); err != nil {
272
+ t .Fatal (err )
273
+ }
274
+ <- offerGatheringComplete
275
+
276
+ err = pcOffer .GracefulClose ()
277
+ if err != nil {
278
+ t .Fatal (err )
279
+ }
280
+
281
+ if err = pcAnswer .SetRemoteDescription (offer ); err != nil {
282
+ t .Fatal (err )
283
+ }
284
+
285
+ err = pcAnswer .GracefulClose ()
286
+ if err != nil {
287
+ t .Fatal (err )
288
+ }
289
+ }
You can’t perform that action at this time.
0 commit comments