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 1001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1012 // Instead we should set an option on the fake TURN server to force it to | 1012 // Instead we should set an option on the fake TURN server to force it to |
1013 // send a channel bind errors. | 1013 // send a channel bind errors. |
1014 ASSERT_TRUE( | 1014 ASSERT_TRUE( |
1015 turn_port_->SetEntryChannelId(udp_port_->Candidates()[0].address(), -1)); | 1015 turn_port_->SetEntryChannelId(udp_port_->Candidates()[0].address(), -1)); |
1016 | 1016 |
1017 std::string data = "ABC"; | 1017 std::string data = "ABC"; |
1018 conn1->Send(data.data(), data.length(), options); | 1018 conn1->Send(data.data(), data.length(), options); |
1019 | 1019 |
1020 EXPECT_TRUE_SIMULATED_WAIT(CheckConnectionFailedAndPruned(conn1), | 1020 EXPECT_TRUE_SIMULATED_WAIT(CheckConnectionFailedAndPruned(conn1), |
1021 kSimulatedRtt, fake_clock_); | 1021 kSimulatedRtt, fake_clock_); |
1022 // Verify that no packet can be sent after a bind request error. | 1022 // Verify that packets are allowed to be sent after a bind request error. |
| 1023 // They'll just use a send indication instead. |
1023 conn2->SignalReadPacket.connect(static_cast<TurnPortTest*>(this), | 1024 conn2->SignalReadPacket.connect(static_cast<TurnPortTest*>(this), |
1024 &TurnPortTest::OnUdpReadPacket); | 1025 &TurnPortTest::OnUdpReadPacket); |
1025 conn1->Send(data.data(), data.length(), options); | 1026 conn1->Send(data.data(), data.length(), options); |
1026 SIMULATED_WAIT(!udp_packets_.empty(), kSimulatedRtt, fake_clock_); | 1027 EXPECT_TRUE_SIMULATED_WAIT(!udp_packets_.empty(), kSimulatedRtt, fake_clock_); |
1027 EXPECT_TRUE(udp_packets_.empty()); | |
1028 } | 1028 } |
1029 | 1029 |
1030 // Do a TURN allocation, establish a UDP connection, and send some data. | 1030 // Do a TURN allocation, establish a UDP connection, and send some data. |
1031 TEST_F(TurnPortTest, TestTurnSendDataTurnUdpToUdp) { | 1031 TEST_F(TurnPortTest, TestTurnSendDataTurnUdpToUdp) { |
1032 // Create ports and prepare addresses. | 1032 // Create ports and prepare addresses. |
1033 CreateTurnPort(kTurnUsername, kTurnPassword, kTurnUdpProtoAddr); | 1033 CreateTurnPort(kTurnUsername, kTurnPassword, kTurnUdpProtoAddr); |
1034 TestTurnSendData(PROTO_UDP); | 1034 TestTurnSendData(PROTO_UDP); |
1035 EXPECT_EQ(UDP_PROTOCOL_NAME, turn_port_->Candidates()[0].relay_protocol()); | 1035 EXPECT_EQ(UDP_PROTOCOL_NAME, turn_port_->Candidates()[0].relay_protocol()); |
1036 } | 1036 } |
1037 | 1037 |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1179 EXPECT_TRUE(turn_port_->Candidates().empty()); | 1179 EXPECT_TRUE(turn_port_->Candidates().empty()); |
1180 turn_port_.reset(); | 1180 turn_port_.reset(); |
1181 rtc::Thread::Current()->Post(RTC_FROM_HERE, this, MSG_TESTFINISH); | 1181 rtc::Thread::Current()->Post(RTC_FROM_HERE, this, MSG_TESTFINISH); |
1182 // Waiting for above message to be processed. | 1182 // Waiting for above message to be processed. |
1183 ASSERT_TRUE_SIMULATED_WAIT(test_finish_, 1, fake_clock_); | 1183 ASSERT_TRUE_SIMULATED_WAIT(test_finish_, 1, fake_clock_); |
1184 EXPECT_EQ(last_fd_count, GetFDCount()); | 1184 EXPECT_EQ(last_fd_count, GetFDCount()); |
1185 } | 1185 } |
1186 #endif | 1186 #endif |
1187 | 1187 |
1188 } // namespace cricket | 1188 } // namespace cricket |
OLD | NEW |