fix: use track SID instead of source ID
This commit is contained in:
+15
-2
@@ -1,6 +1,7 @@
|
||||
package test
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
@@ -57,7 +58,7 @@ func TestSinglePublisher(t *testing.T) {
|
||||
// a new client joins and should get the initial stream
|
||||
c3 := createRTCClient("c3", defaultServerPort)
|
||||
|
||||
withTimeout(t, "c2 should receive two tracks", func() bool {
|
||||
success := withTimeout(t, "c2 should receive two tracks", func() bool {
|
||||
if len(c2.SubscribedTracks()) == 0 {
|
||||
return false
|
||||
}
|
||||
@@ -70,10 +71,13 @@ func TestSinglePublisher(t *testing.T) {
|
||||
assert.Equal(t, "webcam", tr1.StreamID())
|
||||
return true
|
||||
})
|
||||
if !success {
|
||||
t.FailNow()
|
||||
}
|
||||
|
||||
// ensure that new client that has joined also received tracks
|
||||
waitUntilConnected(t, c3)
|
||||
withTimeout(t, "c2 should receive two tracks", func() bool {
|
||||
success = withTimeout(t, "c2 should receive two tracks", func() bool {
|
||||
if len(c3.SubscribedTracks()) == 0 {
|
||||
return false
|
||||
}
|
||||
@@ -83,4 +87,13 @@ func TestSinglePublisher(t *testing.T) {
|
||||
}
|
||||
return true
|
||||
})
|
||||
if !success {
|
||||
t.FailNow()
|
||||
}
|
||||
|
||||
// ensure that the track ids are generated by server
|
||||
tracks := c3.SubscribedTracks()[c1.ID()]
|
||||
for _, tr := range tracks {
|
||||
assert.True(t, strings.Contains(tr.ID(), "|TR_"), "track should begin with TR")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user