This commit is contained in:
Yvan
2026-09-23 11:30:33 +08:00
parent 672c7f8f6c
commit 90adf83966
4 changed files with 83 additions and 11 deletions
+21
View File
@@ -480,6 +480,27 @@ func TestClosedSupersededPeerConnectionDoesNotRemovePeer(t *testing.T) {
}
}
func TestClosedCurrentPeerConnectionDoesNotRemoveSignalingPeer(t *testing.T) {
pc, err := webrtc.NewPeerConnection(webrtc.Configuration{})
if err != nil {
t.Fatal(err)
}
defer pc.Close()
p := &peer{pc: pc}
manager := &Manager{}
manager.handleICEConnectionStateChange(p, pc, webrtc.ICEConnectionStateClosed)
cleanupAvailable := false
p.cleanup.Do(func() { cleanupAvailable = true })
if !cleanupAvailable {
t.Fatal("closed media connection consumed signaling peer cleanup")
}
if !p.hasPeerConnection(pc) {
t.Fatal("closed media connection removed signaling peer before renegotiation")
}
}
var _ platformws.Hub = (*liveHubStub)(nil)
func TestNewPionAPIRejectsConflictingUDPConfiguration(t *testing.T) {