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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 tlsCertPolicy:RTCTlsCertPoli
cySecure | 69 tlsCertPolicy:RTCTlsCertPoli
cySecure |
70 hostname:@"hostname"]; | 70 hostname:@"hostname"]; |
71 webrtc::PeerConnectionInterface::IceServer iceStruct = server.nativeServer; | 71 webrtc::PeerConnectionInterface::IceServer iceStruct = server.nativeServer; |
72 EXPECT_EQ(1u, iceStruct.urls.size()); | 72 EXPECT_EQ(1u, iceStruct.urls.size()); |
73 EXPECT_EQ("turn1:turn1.example.net", iceStruct.urls.front()); | 73 EXPECT_EQ("turn1:turn1.example.net", iceStruct.urls.front()); |
74 EXPECT_EQ("username", iceStruct.username); | 74 EXPECT_EQ("username", iceStruct.username); |
75 EXPECT_EQ("credential", iceStruct.password); | 75 EXPECT_EQ("credential", iceStruct.password); |
76 EXPECT_EQ("hostname", iceStruct.hostname); | 76 EXPECT_EQ("hostname", iceStruct.hostname); |
77 } | 77 } |
78 | 78 |
| 79 - (void)testTlsAlpnProtocols { |
| 80 RTCIceServer *server = [[RTCIceServer alloc] initWithURLStrings:@[ @"turn1:tur
n1.example.net" ] |
| 81 username:@"username" |
| 82 credential:@"credential" |
| 83 tlsCertPolicy:RTCTlsCertPoli
cySecure |
| 84 hostname:@"hostname" |
| 85 tlsAlpnProtocols:@[ @"proto1",@
"proto2" ]]; |
| 86 webrtc::PeerConnectionInterface::IceServer iceStruct = server.nativeServer; |
| 87 EXPECT_EQ(1u, iceStruct.urls.size()); |
| 88 EXPECT_EQ("turn1:turn1.example.net", iceStruct.urls.front()); |
| 89 EXPECT_EQ("username", iceStruct.username); |
| 90 EXPECT_EQ("credential", iceStruct.password); |
| 91 EXPECT_EQ("hostname", iceStruct.hostname); |
| 92 EXPECT_EQ(2u, iceStruct.tls_alpn_protocols.size()); |
| 93 } |
| 94 |
79 - (void)testInitFromNativeServer { | 95 - (void)testInitFromNativeServer { |
80 webrtc::PeerConnectionInterface::IceServer nativeServer; | 96 webrtc::PeerConnectionInterface::IceServer nativeServer; |
81 nativeServer.username = "username"; | 97 nativeServer.username = "username"; |
82 nativeServer.password = "password"; | 98 nativeServer.password = "password"; |
83 nativeServer.urls.push_back("stun:stun.example.net"); | 99 nativeServer.urls.push_back("stun:stun.example.net"); |
84 nativeServer.hostname = "hostname"; | 100 nativeServer.hostname = "hostname"; |
| 101 nativeServer.tls_alpn_protocols.push_back("proto1"); |
| 102 nativeServer.tls_alpn_protocols.push_back("proto2"); |
85 | 103 |
86 RTCIceServer *iceServer = | 104 RTCIceServer *iceServer = |
87 [[RTCIceServer alloc] initWithNativeServer:nativeServer]; | 105 [[RTCIceServer alloc] initWithNativeServer:nativeServer]; |
88 EXPECT_EQ(1u, iceServer.urlStrings.count); | 106 EXPECT_EQ(1u, iceServer.urlStrings.count); |
89 EXPECT_EQ("stun:stun.example.net", | 107 EXPECT_EQ("stun:stun.example.net", |
90 [NSString stdStringForString:iceServer.urlStrings.firstObject]); | 108 [NSString stdStringForString:iceServer.urlStrings.firstObject]); |
91 EXPECT_EQ("username", [NSString stdStringForString:iceServer.username]); | 109 EXPECT_EQ("username", [NSString stdStringForString:iceServer.username]); |
92 EXPECT_EQ("password", [NSString stdStringForString:iceServer.credential]); | 110 EXPECT_EQ("password", [NSString stdStringForString:iceServer.credential]); |
93 EXPECT_EQ("hostname", [NSString stdStringForString:iceServer.hostname]); | 111 EXPECT_EQ("hostname", [NSString stdStringForString:iceServer.hostname]); |
| 112 EXPECT_EQ(2u, iceServer.tlsAlpnProtocols.count); |
94 } | 113 } |
95 | 114 |
96 @end | 115 @end |
97 | 116 |
98 TEST(RTCIceServerTest, OneURLTest) { | 117 TEST(RTCIceServerTest, OneURLTest) { |
99 @autoreleasepool { | 118 @autoreleasepool { |
100 RTCIceServerTest *test = [[RTCIceServerTest alloc] init]; | 119 RTCIceServerTest *test = [[RTCIceServerTest alloc] init]; |
101 [test testOneURLServer]; | 120 [test testOneURLServer]; |
102 } | 121 } |
103 } | 122 } |
(...skipping 18 matching lines...) Expand all Loading... |
122 [test testHostname]; | 141 [test testHostname]; |
123 } | 142 } |
124 } | 143 } |
125 | 144 |
126 TEST(RTCIceServerTest, InitFromNativeServerTest) { | 145 TEST(RTCIceServerTest, InitFromNativeServerTest) { |
127 @autoreleasepool { | 146 @autoreleasepool { |
128 RTCIceServerTest *test = [[RTCIceServerTest alloc] init]; | 147 RTCIceServerTest *test = [[RTCIceServerTest alloc] init]; |
129 [test testInitFromNativeServer]; | 148 [test testInitFromNativeServer]; |
130 } | 149 } |
131 } | 150 } |
OLD | NEW |