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 #if defined(WEBRTC_POSIX) | 10 #if defined(WEBRTC_POSIX) |
(...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
713 turn_server_.set_enable_otu_nonce(true); | 713 turn_server_.set_enable_otu_nonce(true); |
714 CreateTurnPort(kTurnUsername, kTurnPassword, kTurnUdpProtoAddr); | 714 CreateTurnPort(kTurnUsername, kTurnPassword, kTurnUdpProtoAddr); |
715 TestTurnConnection(); | 715 TestTurnConnection(); |
716 } | 716 } |
717 | 717 |
718 // Do a TURN allocation, establish a UDP connection, and send some data. | 718 // Do a TURN allocation, establish a UDP connection, and send some data. |
719 TEST_F(TurnPortTest, TestTurnSendDataTurnUdpToUdp) { | 719 TEST_F(TurnPortTest, TestTurnSendDataTurnUdpToUdp) { |
720 // Create ports and prepare addresses. | 720 // Create ports and prepare addresses. |
721 CreateTurnPort(kTurnUsername, kTurnPassword, kTurnUdpProtoAddr); | 721 CreateTurnPort(kTurnUsername, kTurnPassword, kTurnUdpProtoAddr); |
722 TestTurnSendData(); | 722 TestTurnSendData(); |
723 EXPECT_EQ(turn_port_->Candidates()[0].relay_protocol(), | 723 EXPECT_EQ(cricket::UDP_PROTOCOL_NAME, |
724 cricket::UDP_PROTOCOL_NAME); | 724 turn_port_->Candidates()[0].relay_protocol()); |
725 } | 725 } |
726 | 726 |
727 // Do a TURN allocation, establish a TCP connection, and send some data. | 727 // Do a TURN allocation, establish a TCP connection, and send some data. |
728 TEST_F(TurnPortTest, TestTurnSendDataTurnTcpToUdp) { | 728 TEST_F(TurnPortTest, TestTurnSendDataTurnTcpToUdp) { |
729 turn_server_.AddInternalSocket(kTurnTcpIntAddr, cricket::PROTO_TCP); | 729 turn_server_.AddInternalSocket(kTurnTcpIntAddr, cricket::PROTO_TCP); |
730 // Create ports and prepare addresses. | 730 // Create ports and prepare addresses. |
731 CreateTurnPort(kTurnUsername, kTurnPassword, kTurnTcpProtoAddr); | 731 CreateTurnPort(kTurnUsername, kTurnPassword, kTurnTcpProtoAddr); |
732 TestTurnSendData(); | 732 TestTurnSendData(); |
733 EXPECT_EQ(turn_port_->Candidates()[0].relay_protocol(), | 733 EXPECT_EQ(cricket::TCP_PROTOCOL_NAME, |
734 cricket::TCP_PROTOCOL_NAME); | 734 turn_port_->Candidates()[0].relay_protocol()); |
735 } | 735 } |
736 | 736 |
737 // Test TURN fails to make a connection from IPv6 address to a server which has | 737 // Test TURN fails to make a connection from IPv6 address to a server which has |
738 // IPv4 address. | 738 // IPv4 address. |
739 TEST_F(TurnPortTest, TestTurnLocalIPv6AddressServerIPv4) { | 739 TEST_F(TurnPortTest, TestTurnLocalIPv6AddressServerIPv4) { |
740 turn_server_.AddInternalSocket(kTurnUdpIPv6IntAddr, cricket::PROTO_UDP); | 740 turn_server_.AddInternalSocket(kTurnUdpIPv6IntAddr, cricket::PROTO_UDP); |
741 CreateTurnPort(kLocalIPv6Addr, kTurnUsername, kTurnPassword, | 741 CreateTurnPort(kLocalIPv6Addr, kTurnUsername, kTurnPassword, |
742 kTurnUdpProtoAddr); | 742 kTurnUdpProtoAddr); |
743 turn_port_->PrepareAddress(); | 743 turn_port_->PrepareAddress(); |
744 ASSERT_TRUE_WAIT(turn_error_, kTimeout); | 744 ASSERT_TRUE_WAIT(turn_error_, kTimeout); |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
807 turn_port_->PrepareAddress(); | 807 turn_port_->PrepareAddress(); |
808 ASSERT_TRUE_WAIT(turn_error_, kTimeout); | 808 ASSERT_TRUE_WAIT(turn_error_, kTimeout); |
809 EXPECT_TRUE(turn_port_->Candidates().empty()); | 809 EXPECT_TRUE(turn_port_->Candidates().empty()); |
810 turn_port_.reset(); | 810 turn_port_.reset(); |
811 rtc::Thread::Current()->Post(this, MSG_TESTFINISH); | 811 rtc::Thread::Current()->Post(this, MSG_TESTFINISH); |
812 // Waiting for above message to be processed. | 812 // Waiting for above message to be processed. |
813 ASSERT_TRUE_WAIT(test_finish_, kTimeout); | 813 ASSERT_TRUE_WAIT(test_finish_, kTimeout); |
814 EXPECT_EQ(last_fd_count, GetFDCount()); | 814 EXPECT_EQ(last_fd_count, GetFDCount()); |
815 } | 815 } |
816 #endif | 816 #endif |
OLD | NEW |