(t *testing.T, opts testRoomOpts)
| 814 | } |
| 815 | |
| 816 | func newRoomWithParticipants(t *testing.T, opts testRoomOpts) *Room { |
| 817 | kp := &authfakes.FakeKeyProvider{} |
| 818 | kp.GetSecretReturns("testkey") |
| 819 | |
| 820 | n, err := webhook.NewDefaultNotifier(webhook.DefaultWebHookConfig, kp) |
| 821 | require.NoError(t, err) |
| 822 | |
| 823 | rm := NewRoom( |
| 824 | &livekit.Room{Name: "room"}, |
| 825 | nil, |
| 826 | WebRTCConfig{}, |
| 827 | config.RoomConfig{ |
| 828 | EmptyTimeout: 5 * 60, |
| 829 | DepartureTimeout: 1, |
| 830 | }, |
| 831 | &sfu.AudioConfig{ |
| 832 | AudioLevelConfig: audio.AudioLevelConfig{ |
| 833 | UpdateInterval: audioUpdateInterval, |
| 834 | SmoothIntervals: opts.audioSmoothIntervals, |
| 835 | }, |
| 836 | }, |
| 837 | &livekit.ServerInfo{ |
| 838 | Edition: livekit.ServerInfo_Standard, |
| 839 | Version: version.Version, |
| 840 | Protocol: types.CurrentProtocol, |
| 841 | NodeId: "testnode", |
| 842 | Region: "testregion", |
| 843 | }, |
| 844 | telemetry.NewTelemetryService(n, &telemetryfakes.FakeAnalyticsService{}), |
| 845 | nil, nil, nil, |
| 846 | ) |
| 847 | for i := 0; i < opts.num+opts.numHidden; i++ { |
| 848 | identity := livekit.ParticipantIdentity(fmt.Sprintf("p%d", i)) |
| 849 | participant := NewMockParticipant(identity, opts.protocol, i >= opts.num, true, rm.LocalParticipantListener()) |
| 850 | err := rm.Join(participant, nil, &ParticipantOptions{AutoSubscribe: true}, iceServersForRoom) |
| 851 | require.NoError(t, err) |
| 852 | participant.StateReturns(livekit.ParticipantInfo_ACTIVE) |
| 853 | participant.IsReadyReturns(true) |
| 854 | // each participant has a track |
| 855 | participant.GetPublishedTracksReturns([]types.MediaTrack{ |
| 856 | &typesfakes.FakeMediaTrack{}, |
| 857 | }) |
| 858 | } |
| 859 | return rm |
| 860 | } |
no test coverage detected