mirror of
https://github.com/aler9/rtsp-simple-server
synced 2025-10-05 07:36:57 +08:00
29 lines
536 B
Go
29 lines
536 B
Go
package webrtc
|
|
|
|
import (
|
|
"testing"
|
|
"time"
|
|
|
|
"github.com/bluenviron/mediamtx/internal/test"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestPeerConnectionCloseAfterError(t *testing.T) {
|
|
pc := &PeerConnection{
|
|
LocalRandomUDP: true,
|
|
IPsFromInterfaces: true,
|
|
Publish: false,
|
|
Log: test.NilLogger,
|
|
}
|
|
err := pc.Start()
|
|
require.NoError(t, err)
|
|
|
|
_, err = pc.CreatePartialOffer()
|
|
require.NoError(t, err)
|
|
|
|
// wait for ICE candidates to be generated
|
|
time.Sleep(500 * time.Millisecond)
|
|
|
|
pc.Close()
|
|
}
|