Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Side by Side Diff: webrtc/sdk/objc/Framework/UnitTests/RTCConfigurationTest.mm

Issue 2120553002: Add pruneTurnPorts to the IOS RTCConfiguration. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: . Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 26 matching lines...) Expand all
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.iceConnectionReceivingTimeout = timeout; 43 config.iceConnectionReceivingTimeout = timeout;
44 config.iceBackupCandidatePairPingInterval = interval; 44 config.iceBackupCandidatePairPingInterval = interval;
45 config.continualGatheringPolicy = 45 config.continualGatheringPolicy =
46 RTCContinualGatheringPolicyGatherContinually; 46 RTCContinualGatheringPolicyGatherContinually;
47 config.pruneTurnPorts = true;
47 48
48 std::unique_ptr<webrtc::PeerConnectionInterface::RTCConfiguration> 49 std::unique_ptr<webrtc::PeerConnectionInterface::RTCConfiguration>
49 nativeConfig([config createNativeConfiguration]); 50 nativeConfig([config createNativeConfiguration]);
50 EXPECT_TRUE(nativeConfig.get()); 51 EXPECT_TRUE(nativeConfig.get());
51 EXPECT_EQ(1u, nativeConfig->servers.size()); 52 EXPECT_EQ(1u, nativeConfig->servers.size());
52 webrtc::PeerConnectionInterface::IceServer nativeServer = 53 webrtc::PeerConnectionInterface::IceServer nativeServer =
53 nativeConfig->servers.front(); 54 nativeConfig->servers.front();
54 EXPECT_EQ(1u, nativeServer.urls.size()); 55 EXPECT_EQ(1u, nativeServer.urls.size());
55 EXPECT_EQ("stun:stun1.example.net", nativeServer.urls.front()); 56 EXPECT_EQ("stun:stun1.example.net", nativeServer.urls.front());
56 57
57 EXPECT_EQ(webrtc::PeerConnectionInterface::kRelay, nativeConfig->type); 58 EXPECT_EQ(webrtc::PeerConnectionInterface::kRelay, nativeConfig->type);
58 EXPECT_EQ(webrtc::PeerConnectionInterface::kBundlePolicyMaxBundle, 59 EXPECT_EQ(webrtc::PeerConnectionInterface::kBundlePolicyMaxBundle,
59 nativeConfig->bundle_policy); 60 nativeConfig->bundle_policy);
60 EXPECT_EQ(webrtc::PeerConnectionInterface::kRtcpMuxPolicyNegotiate, 61 EXPECT_EQ(webrtc::PeerConnectionInterface::kRtcpMuxPolicyNegotiate,
61 nativeConfig->rtcp_mux_policy); 62 nativeConfig->rtcp_mux_policy);
62 EXPECT_EQ(webrtc::PeerConnectionInterface::kTcpCandidatePolicyDisabled, 63 EXPECT_EQ(webrtc::PeerConnectionInterface::kTcpCandidatePolicyDisabled,
63 nativeConfig->tcp_candidate_policy); 64 nativeConfig->tcp_candidate_policy);
64 EXPECT_EQ(webrtc::PeerConnectionInterface::kCandidateNetworkPolicyLowCost, 65 EXPECT_EQ(webrtc::PeerConnectionInterface::kCandidateNetworkPolicyLowCost,
65 nativeConfig->candidate_network_policy); 66 nativeConfig->candidate_network_policy);
66 EXPECT_EQ(maxPackets, nativeConfig->audio_jitter_buffer_max_packets); 67 EXPECT_EQ(maxPackets, nativeConfig->audio_jitter_buffer_max_packets);
67 EXPECT_EQ(timeout, nativeConfig->ice_connection_receiving_timeout); 68 EXPECT_EQ(timeout, nativeConfig->ice_connection_receiving_timeout);
68 EXPECT_EQ(interval, nativeConfig->ice_backup_candidate_pair_ping_interval); 69 EXPECT_EQ(interval, nativeConfig->ice_backup_candidate_pair_ping_interval);
69 EXPECT_EQ(webrtc::PeerConnectionInterface::GATHER_CONTINUALLY, 70 EXPECT_EQ(webrtc::PeerConnectionInterface::GATHER_CONTINUALLY,
70 nativeConfig->continual_gathering_policy); 71 nativeConfig->continual_gathering_policy);
72 EXPECT_EQ(true, nativeConfig->prune_turn_ports);
71 } 73 }
72 74
73 @end 75 @end
74 76
75 TEST(RTCConfigurationTest, NativeConfigurationConversionTest) { 77 TEST(RTCConfigurationTest, NativeConfigurationConversionTest) {
76 @autoreleasepool { 78 @autoreleasepool {
77 RTCConfigurationTest *test = [[RTCConfigurationTest alloc] init]; 79 RTCConfigurationTest *test = [[RTCConfigurationTest alloc] init];
78 [test testConversionToNativeConfiguration]; 80 [test testConversionToNativeConfiguration];
79 } 81 }
80 } 82 }
81 83
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698