OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 22 matching lines...) Expand all Loading... |
33 config.iceServers = @[ server ]; | 33 config.iceServers = @[ server ]; |
34 config.iceTransportPolicy = RTCIceTransportPolicyRelay; | 34 config.iceTransportPolicy = RTCIceTransportPolicyRelay; |
35 config.bundlePolicy = RTCBundlePolicyMaxBundle; | 35 config.bundlePolicy = RTCBundlePolicyMaxBundle; |
36 config.rtcpMuxPolicy = RTCRtcpMuxPolicyNegotiate; | 36 config.rtcpMuxPolicy = RTCRtcpMuxPolicyNegotiate; |
37 config.tcpCandidatePolicy = RTCTcpCandidatePolicyDisabled; | 37 config.tcpCandidatePolicy = RTCTcpCandidatePolicyDisabled; |
38 config.candidateNetworkPolicy = RTCCandidateNetworkPolicyLowCost; | 38 config.candidateNetworkPolicy = RTCCandidateNetworkPolicyLowCost; |
39 const int maxPackets = 60; | 39 const int maxPackets = 60; |
40 const int timeout = 1; | 40 const int timeout = 1; |
41 const int interval = 2; | 41 const int interval = 2; |
42 config.audioJitterBufferMaxPackets = maxPackets; | 42 config.audioJitterBufferMaxPackets = maxPackets; |
| 43 config.audioJitterBufferFastAccelerate = YES; |
43 config.iceConnectionReceivingTimeout = timeout; | 44 config.iceConnectionReceivingTimeout = timeout; |
44 config.iceBackupCandidatePairPingInterval = interval; | 45 config.iceBackupCandidatePairPingInterval = interval; |
45 config.continualGatheringPolicy = | 46 config.continualGatheringPolicy = |
46 RTCContinualGatheringPolicyGatherContinually; | 47 RTCContinualGatheringPolicyGatherContinually; |
47 config.shouldPruneTurnPorts = YES; | 48 config.shouldPruneTurnPorts = YES; |
48 | 49 |
49 std::unique_ptr<webrtc::PeerConnectionInterface::RTCConfiguration> | 50 std::unique_ptr<webrtc::PeerConnectionInterface::RTCConfiguration> |
50 nativeConfig([config createNativeConfiguration]); | 51 nativeConfig([config createNativeConfiguration]); |
51 EXPECT_TRUE(nativeConfig.get()); | 52 EXPECT_TRUE(nativeConfig.get()); |
52 EXPECT_EQ(1u, nativeConfig->servers.size()); | 53 EXPECT_EQ(1u, nativeConfig->servers.size()); |
53 webrtc::PeerConnectionInterface::IceServer nativeServer = | 54 webrtc::PeerConnectionInterface::IceServer nativeServer = |
54 nativeConfig->servers.front(); | 55 nativeConfig->servers.front(); |
55 EXPECT_EQ(1u, nativeServer.urls.size()); | 56 EXPECT_EQ(1u, nativeServer.urls.size()); |
56 EXPECT_EQ("stun:stun1.example.net", nativeServer.urls.front()); | 57 EXPECT_EQ("stun:stun1.example.net", nativeServer.urls.front()); |
57 | 58 |
58 EXPECT_EQ(webrtc::PeerConnectionInterface::kRelay, nativeConfig->type); | 59 EXPECT_EQ(webrtc::PeerConnectionInterface::kRelay, nativeConfig->type); |
59 EXPECT_EQ(webrtc::PeerConnectionInterface::kBundlePolicyMaxBundle, | 60 EXPECT_EQ(webrtc::PeerConnectionInterface::kBundlePolicyMaxBundle, |
60 nativeConfig->bundle_policy); | 61 nativeConfig->bundle_policy); |
61 EXPECT_EQ(webrtc::PeerConnectionInterface::kRtcpMuxPolicyNegotiate, | 62 EXPECT_EQ(webrtc::PeerConnectionInterface::kRtcpMuxPolicyNegotiate, |
62 nativeConfig->rtcp_mux_policy); | 63 nativeConfig->rtcp_mux_policy); |
63 EXPECT_EQ(webrtc::PeerConnectionInterface::kTcpCandidatePolicyDisabled, | 64 EXPECT_EQ(webrtc::PeerConnectionInterface::kTcpCandidatePolicyDisabled, |
64 nativeConfig->tcp_candidate_policy); | 65 nativeConfig->tcp_candidate_policy); |
65 EXPECT_EQ(webrtc::PeerConnectionInterface::kCandidateNetworkPolicyLowCost, | 66 EXPECT_EQ(webrtc::PeerConnectionInterface::kCandidateNetworkPolicyLowCost, |
66 nativeConfig->candidate_network_policy); | 67 nativeConfig->candidate_network_policy); |
67 EXPECT_EQ(maxPackets, nativeConfig->audio_jitter_buffer_max_packets); | 68 EXPECT_EQ(maxPackets, nativeConfig->audio_jitter_buffer_max_packets); |
| 69 EXPECT_EQ(true, nativeConfig->audio_jitter_buffer_fast_accelerate); |
68 EXPECT_EQ(timeout, nativeConfig->ice_connection_receiving_timeout); | 70 EXPECT_EQ(timeout, nativeConfig->ice_connection_receiving_timeout); |
69 EXPECT_EQ(interval, nativeConfig->ice_backup_candidate_pair_ping_interval); | 71 EXPECT_EQ(interval, nativeConfig->ice_backup_candidate_pair_ping_interval); |
70 EXPECT_EQ(webrtc::PeerConnectionInterface::GATHER_CONTINUALLY, | 72 EXPECT_EQ(webrtc::PeerConnectionInterface::GATHER_CONTINUALLY, |
71 nativeConfig->continual_gathering_policy); | 73 nativeConfig->continual_gathering_policy); |
72 EXPECT_EQ(true, nativeConfig->prune_turn_ports); | 74 EXPECT_EQ(true, nativeConfig->prune_turn_ports); |
73 } | 75 } |
74 | 76 |
75 @end | 77 @end |
76 | 78 |
77 TEST(RTCConfigurationTest, NativeConfigurationConversionTest) { | 79 TEST(RTCConfigurationTest, NativeConfigurationConversionTest) { |
78 @autoreleasepool { | 80 @autoreleasepool { |
79 RTCConfigurationTest *test = [[RTCConfigurationTest alloc] init]; | 81 RTCConfigurationTest *test = [[RTCConfigurationTest alloc] init]; |
80 [test testConversionToNativeConfiguration]; | 82 [test testConversionToNativeConfiguration]; |
81 } | 83 } |
82 } | 84 } |
83 | 85 |
OLD | NEW |