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 13 matching lines...) Expand all Loading... |
24 - (void)testPasswordCredential; | 24 - (void)testPasswordCredential; |
25 - (void)testInitFromNativeServer; | 25 - (void)testInitFromNativeServer; |
26 @end | 26 @end |
27 | 27 |
28 @implementation RTCIceServerTest | 28 @implementation RTCIceServerTest |
29 | 29 |
30 - (void)testOneURLServer { | 30 - (void)testOneURLServer { |
31 RTCIceServer *server = [[RTCIceServer alloc] initWithURLStrings:@[ | 31 RTCIceServer *server = [[RTCIceServer alloc] initWithURLStrings:@[ |
32 @"stun:stun1.example.net" ]]; | 32 @"stun:stun1.example.net" ]]; |
33 | 33 |
34 webrtc::PeerConnectionInterface::IceServer iceStruct = server.iceServer; | 34 webrtc::PeerConnectionInterface::IceServer iceStruct = server.nativeServer; |
35 EXPECT_EQ(1u, iceStruct.urls.size()); | 35 EXPECT_EQ(1u, iceStruct.urls.size()); |
36 EXPECT_EQ("stun:stun1.example.net", iceStruct.urls.front()); | 36 EXPECT_EQ("stun:stun1.example.net", iceStruct.urls.front()); |
37 EXPECT_EQ("", iceStruct.username); | 37 EXPECT_EQ("", iceStruct.username); |
38 EXPECT_EQ("", iceStruct.password); | 38 EXPECT_EQ("", iceStruct.password); |
39 } | 39 } |
40 | 40 |
41 - (void)testTwoURLServer { | 41 - (void)testTwoURLServer { |
42 RTCIceServer *server = [[RTCIceServer alloc] initWithURLStrings:@[ | 42 RTCIceServer *server = [[RTCIceServer alloc] initWithURLStrings:@[ |
43 @"turn1:turn1.example.net", @"turn2:turn2.example.net" ]]; | 43 @"turn1:turn1.example.net", @"turn2:turn2.example.net" ]]; |
44 | 44 |
45 webrtc::PeerConnectionInterface::IceServer iceStruct = server.iceServer; | 45 webrtc::PeerConnectionInterface::IceServer iceStruct = server.nativeServer; |
46 EXPECT_EQ(2u, iceStruct.urls.size()); | 46 EXPECT_EQ(2u, iceStruct.urls.size()); |
47 EXPECT_EQ("turn1:turn1.example.net", iceStruct.urls.front()); | 47 EXPECT_EQ("turn1:turn1.example.net", iceStruct.urls.front()); |
48 EXPECT_EQ("turn2:turn2.example.net", iceStruct.urls.back()); | 48 EXPECT_EQ("turn2:turn2.example.net", iceStruct.urls.back()); |
49 EXPECT_EQ("", iceStruct.username); | 49 EXPECT_EQ("", iceStruct.username); |
50 EXPECT_EQ("", iceStruct.password); | 50 EXPECT_EQ("", iceStruct.password); |
51 } | 51 } |
52 | 52 |
53 - (void)testPasswordCredential { | 53 - (void)testPasswordCredential { |
54 RTCIceServer *server = [[RTCIceServer alloc] | 54 RTCIceServer *server = [[RTCIceServer alloc] |
55 initWithURLStrings:@[ @"turn1:turn1.example.net" ] | 55 initWithURLStrings:@[ @"turn1:turn1.example.net" ] |
56 username:@"username" | 56 username:@"username" |
57 credential:@"credential"]; | 57 credential:@"credential"]; |
58 webrtc::PeerConnectionInterface::IceServer iceStruct = server.iceServer; | 58 webrtc::PeerConnectionInterface::IceServer iceStruct = server.nativeServer; |
59 EXPECT_EQ(1u, iceStruct.urls.size()); | 59 EXPECT_EQ(1u, iceStruct.urls.size()); |
60 EXPECT_EQ("turn1:turn1.example.net", iceStruct.urls.front()); | 60 EXPECT_EQ("turn1:turn1.example.net", iceStruct.urls.front()); |
61 EXPECT_EQ("username", iceStruct.username); | 61 EXPECT_EQ("username", iceStruct.username); |
62 EXPECT_EQ("credential", iceStruct.password); | 62 EXPECT_EQ("credential", iceStruct.password); |
63 } | 63 } |
64 | 64 |
65 - (void)testInitFromNativeServer { | 65 - (void)testInitFromNativeServer { |
66 webrtc::PeerConnectionInterface::IceServer nativeServer; | 66 webrtc::PeerConnectionInterface::IceServer nativeServer; |
67 nativeServer.username = "username"; | 67 nativeServer.username = "username"; |
68 nativeServer.password = "password"; | 68 nativeServer.password = "password"; |
(...skipping 30 matching lines...) Expand all Loading... |
99 [test testPasswordCredential]; | 99 [test testPasswordCredential]; |
100 } | 100 } |
101 } | 101 } |
102 | 102 |
103 TEST(RTCIceServerTest, InitFromNativeServerTest) { | 103 TEST(RTCIceServerTest, InitFromNativeServerTest) { |
104 @autoreleasepool { | 104 @autoreleasepool { |
105 RTCIceServerTest *test = [[RTCIceServerTest alloc] init]; | 105 RTCIceServerTest *test = [[RTCIceServerTest alloc] init]; |
106 [test testInitFromNativeServer]; | 106 [test testInitFromNativeServer]; |
107 } | 107 } |
108 } | 108 } |
OLD | NEW |