|
17 | 17 | package io.livekit.android.room |
18 | 18 |
|
19 | 19 | import com.google.protobuf.ByteString |
| 20 | +import io.livekit.android.ConnectOptions |
20 | 21 | import io.livekit.android.room.track.TrackException |
21 | 22 | import io.livekit.android.test.MockE2ETest |
22 | 23 | import io.livekit.android.test.events.FlowCollector |
@@ -84,6 +85,38 @@ class RTCEngineMockE2ETest : MockE2ETest() { |
84 | 85 | assertEquals(sentIceServers, subPeerConnection.rtcConfig.iceServers) |
85 | 86 | } |
86 | 87 |
|
| 88 | + @Test |
| 89 | + fun customRtcConfigWithEmptyIceServersUsesServerIceServers() = runTest { |
| 90 | + val connectJob = async { |
| 91 | + room.connect( |
| 92 | + url = TestData.EXAMPLE_URL, |
| 93 | + token = "token", |
| 94 | + options = ConnectOptions( |
| 95 | + rtcConfig = PeerConnection.RTCConfiguration(emptyList()).apply { |
| 96 | + iceTransportsType = PeerConnection.IceTransportsType.RELAY |
| 97 | + }, |
| 98 | + ), |
| 99 | + ) |
| 100 | + } |
| 101 | + prepareSignal(TestData.JOIN) |
| 102 | + connectJob.await() |
| 103 | + connectPeerConnection() |
| 104 | + |
| 105 | + val subPeerConnection = getSubscriberPeerConnection() |
| 106 | + assertEquals(PeerConnection.IceTransportsType.RELAY, subPeerConnection.rtcConfig.iceTransportsType) |
| 107 | + val sentIceServers = TestData.JOIN.join.iceServersList |
| 108 | + .map { it.toWebrtc() } |
| 109 | + assertEquals(sentIceServers, subPeerConnection.rtcConfig.iceServers) |
| 110 | + assertEquals( |
| 111 | + PeerConnection.SdpSemantics.UNIFIED_PLAN, |
| 112 | + subPeerConnection.rtcConfig.sdpSemantics, |
| 113 | + ) |
| 114 | + assertEquals( |
| 115 | + PeerConnection.ContinualGatheringPolicy.GATHER_CONTINUALLY, |
| 116 | + subPeerConnection.rtcConfig.continualGatheringPolicy, |
| 117 | + ) |
| 118 | + } |
| 119 | + |
87 | 120 | @Test |
88 | 121 | fun roomConnectDoesNotHangOnWebSocketFailure() = runTest { |
89 | 122 | val connectJob = async { |
|
0 commit comments