| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2012 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 2749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2760 turn_servers_.clear(); | 2760 turn_servers_.clear(); |
| 2761 | 2761 |
| 2762 EXPECT_TRUE(ParseTurnUrl("turn:hostname?transport=udp")); | 2762 EXPECT_TRUE(ParseTurnUrl("turn:hostname?transport=udp")); |
| 2763 EXPECT_EQ(1U, turn_servers_.size()); | 2763 EXPECT_EQ(1U, turn_servers_.size()); |
| 2764 EXPECT_EQ(cricket::PROTO_UDP, turn_servers_[0].ports[0].proto); | 2764 EXPECT_EQ(cricket::PROTO_UDP, turn_servers_[0].ports[0].proto); |
| 2765 turn_servers_.clear(); | 2765 turn_servers_.clear(); |
| 2766 | 2766 |
| 2767 EXPECT_FALSE(ParseTurnUrl("turn:hostname?transport=invalid")); | 2767 EXPECT_FALSE(ParseTurnUrl("turn:hostname?transport=invalid")); |
| 2768 EXPECT_FALSE(ParseTurnUrl("turn:hostname?transport=")); | 2768 EXPECT_FALSE(ParseTurnUrl("turn:hostname?transport=")); |
| 2769 EXPECT_FALSE(ParseTurnUrl("turn:hostname?=")); | 2769 EXPECT_FALSE(ParseTurnUrl("turn:hostname?=")); |
| 2770 EXPECT_FALSE(ParseTurnUrl("turn:hostname?")); |
| 2770 EXPECT_FALSE(ParseTurnUrl("?")); | 2771 EXPECT_FALSE(ParseTurnUrl("?")); |
| 2771 } | 2772 } |
| 2772 | 2773 |
| 2773 // Test parsing ICE username contained in URL. | 2774 // Test parsing ICE username contained in URL. |
| 2774 TEST_F(IceServerParsingTest, ParseUsername) { | 2775 TEST_F(IceServerParsingTest, ParseUsername) { |
| 2775 EXPECT_TRUE(ParseTurnUrl("turn:user@hostname")); | 2776 EXPECT_TRUE(ParseTurnUrl("turn:user@hostname")); |
| 2776 EXPECT_EQ(1U, turn_servers_.size()); | 2777 EXPECT_EQ(1U, turn_servers_.size()); |
| 2777 EXPECT_EQ("user", turn_servers_[0].credentials.username); | 2778 EXPECT_EQ("user", turn_servers_[0].credentials.username); |
| 2778 turn_servers_.clear(); | 2779 turn_servers_.clear(); |
| 2779 | 2780 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2819 servers.push_back(server); | 2820 servers.push_back(server); |
| 2820 EXPECT_EQ(webrtc::RTCErrorType::NONE, | 2821 EXPECT_EQ(webrtc::RTCErrorType::NONE, |
| 2821 webrtc::ParseIceServers(servers, &stun_servers_, &turn_servers_)); | 2822 webrtc::ParseIceServers(servers, &stun_servers_, &turn_servers_)); |
| 2822 EXPECT_EQ(2U, turn_servers_.size()); | 2823 EXPECT_EQ(2U, turn_servers_.size()); |
| 2823 EXPECT_NE(turn_servers_[0].priority, turn_servers_[1].priority); | 2824 EXPECT_NE(turn_servers_[0].priority, turn_servers_[1].priority); |
| 2824 } | 2825 } |
| 2825 | 2826 |
| 2826 #endif // if !defined(THREAD_SANITIZER) | 2827 #endif // if !defined(THREAD_SANITIZER) |
| 2827 | 2828 |
| 2828 } // namespace | 2829 } // namespace |
| OLD | NEW |