@@ -2203,3 +2203,40 @@ func TestAddICECandidate__DroppingOldGenerationCandidates(t *testing.T) {
22032203
22042204 closePairNow (t , pc , remotePC )
22052205}
2206+
2207+ func TestPeerConnectionCanTrickleICECandidatesGo (t * testing.T ) {
2208+ offerPC , answerPC , wan := createVNetPair (t , nil )
2209+ var err error
2210+ defer func () {
2211+ assert .NoError (t , wan .Stop ())
2212+ closePairNow (t , offerPC , answerPC )
2213+ }()
2214+
2215+ _ , err = offerPC .CreateDataChannel ("trickle" , nil )
2216+ assert .NoError (t , err )
2217+
2218+ offer , err := offerPC .CreateOffer (& OfferOptions {
2219+ OfferAnswerOptions : OfferAnswerOptions {ICETricklingSupported : true },
2220+ })
2221+ assert .NoError (t , err )
2222+ assert .NoError (t , offerPC .SetLocalDescription (offer ))
2223+ assert .Equal (t , ICETrickleCapabilityUnknown , answerPC .CanTrickleICECandidates ())
2224+ assert .NoError (t , answerPC .SetRemoteDescription (offer ))
2225+ assert .Equal (t , ICETrickleCapabilitySupported , answerPC .CanTrickleICECandidates ())
2226+
2227+ noTrickleOfferPC , noTrickleAnswerPC , noTrickleWAN := createVNetPair (t , nil )
2228+ defer func () {
2229+ assert .NoError (t , noTrickleWAN .Stop ())
2230+ closePairNow (t , noTrickleOfferPC , noTrickleAnswerPC )
2231+ }()
2232+
2233+ _ , err = noTrickleOfferPC .CreateDataChannel ("notrickle" , nil )
2234+ assert .NoError (t , err )
2235+
2236+ noTrickleOffer , err := noTrickleOfferPC .CreateOffer (nil )
2237+ assert .NoError (t , err )
2238+ assert .NoError (t , noTrickleOfferPC .SetLocalDescription (noTrickleOffer ))
2239+ assert .Equal (t , ICETrickleCapabilityUnknown , noTrickleAnswerPC .CanTrickleICECandidates ())
2240+ assert .NoError (t , noTrickleAnswerPC .SetRemoteDescription (noTrickleOffer ))
2241+ assert .Equal (t , ICETrickleCapabilityUnsupported , noTrickleAnswerPC .CanTrickleICECandidates ())
2242+ }
0 commit comments