This commit is contained in:
Yvan
2026-09-23 17:42:55 +08:00
parent ac42e25868
commit 546cb49fec
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) {