mirror of
https://github.com/pion/webrtc.git
synced 2025-10-05 15:16:52 +08:00
Update module github.com/pion/ice/v3 to v3.0.7
Generated by renovateBot
This commit is contained in:
![29139614+renovate[bot]@users.noreply.github.com](/assets/img/avatar_default.png)
committed by
Sean DuBois

parent
a97c420d0c
commit
480be18a34
@@ -13,6 +13,8 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/pion/dtls/v2/pkg/crypto/elliptic"
|
||||
"github.com/pion/ice/v3"
|
||||
"github.com/pion/stun/v2"
|
||||
"github.com/pion/transport/v3/test"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
@@ -278,3 +280,32 @@ func TestSetSCTPRTOMax(t *testing.T) {
|
||||
s.SetSCTPRTOMax(expSize)
|
||||
assert.Equal(t, expSize, s.sctp.rtoMax)
|
||||
}
|
||||
|
||||
func TestSetICEBindingRequestHandler(t *testing.T) {
|
||||
seenICEControlled, seenICEControlledCancel := context.WithCancel(context.Background())
|
||||
seenICEControlling, seenICEControllingCancel := context.WithCancel(context.Background())
|
||||
|
||||
s := SettingEngine{}
|
||||
s.SetICEBindingRequestHandler(func(m *stun.Message, _, _ ice.Candidate, _ *ice.CandidatePair) bool {
|
||||
for _, a := range m.Attributes {
|
||||
switch a.Type {
|
||||
case stun.AttrICEControlled:
|
||||
seenICEControlledCancel()
|
||||
case stun.AttrICEControlling:
|
||||
seenICEControllingCancel()
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
})
|
||||
|
||||
pcOffer, pcAnswer, err := NewAPI(WithSettingEngine(s)).newPair(Configuration{})
|
||||
assert.NoError(t, err)
|
||||
|
||||
assert.NoError(t, signalPair(pcOffer, pcAnswer))
|
||||
|
||||
<-seenICEControlled.Done()
|
||||
<-seenICEControlling.Done()
|
||||
closePairNow(t, pcOffer, pcAnswer)
|
||||
}
|
||||
|
Reference in New Issue
Block a user