OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2009 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2009 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 952 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
963 cricket::TransportChannel* transport_channel1 = | 963 cricket::TransportChannel* transport_channel1 = |
964 channel1_->transport_channel(); | 964 channel1_->transport_channel(); |
965 ASSERT_TRUE(transport_channel1 != nullptr); | 965 ASSERT_TRUE(transport_channel1 != nullptr); |
966 typename T::MediaChannel* media_channel1 = | 966 typename T::MediaChannel* media_channel1 = |
967 static_cast<typename T::MediaChannel*>(channel1_->media_channel()); | 967 static_cast<typename T::MediaChannel*>(channel1_->media_channel()); |
968 ASSERT_TRUE(media_channel1 != nullptr); | 968 ASSERT_TRUE(media_channel1 != nullptr); |
969 | 969 |
970 media_channel1_->set_num_network_route_changes(0); | 970 media_channel1_->set_num_network_route_changes(0); |
971 // The transport channel becomes disconnected. | 971 // The transport channel becomes disconnected. |
972 transport_channel1->SignalSelectedCandidatePairChanged(transport_channel1, | 972 transport_channel1->SignalSelectedCandidatePairChanged(transport_channel1, |
973 nullptr); | 973 nullptr, -1); |
974 EXPECT_EQ(1, media_channel1_->num_network_route_changes()); | 974 EXPECT_EQ(1, media_channel1_->num_network_route_changes()); |
975 EXPECT_FALSE(media_channel1->last_network_route().connected); | 975 EXPECT_FALSE(media_channel1->last_network_route().connected); |
976 | 976 |
977 media_channel1_->set_num_network_route_changes(0); | 977 media_channel1_->set_num_network_route_changes(0); |
978 // The transport channel becomes connected. | 978 // The transport channel becomes connected. |
979 rtc::SocketAddress local_address("192.168.1.1", 1000 /* port number */); | 979 rtc::SocketAddress local_address("192.168.1.1", 1000 /* port number */); |
980 rtc::SocketAddress remote_address("192.168.1.2", 2000 /* port number */); | 980 rtc::SocketAddress remote_address("192.168.1.2", 2000 /* port number */); |
981 uint16_t local_net_id = 1; | 981 uint16_t local_net_id = 1; |
982 uint16_t remote_net_id = 2; | 982 uint16_t remote_net_id = 2; |
| 983 int last_packet_id = 100; |
983 rtc::scoped_ptr<cricket::CandidatePairInterface> candidate_pair( | 984 rtc::scoped_ptr<cricket::CandidatePairInterface> candidate_pair( |
984 transport_controller1_.CreateFakeCandidatePair( | 985 transport_controller1_.CreateFakeCandidatePair( |
985 local_address, local_net_id, remote_address, remote_net_id)); | 986 local_address, local_net_id, remote_address, remote_net_id)); |
986 transport_channel1->SignalSelectedCandidatePairChanged( | 987 transport_channel1->SignalSelectedCandidatePairChanged( |
987 transport_channel1, candidate_pair.get()); | 988 transport_channel1, candidate_pair.get(), last_packet_id); |
988 EXPECT_EQ(1, media_channel1_->num_network_route_changes()); | 989 EXPECT_EQ(1, media_channel1_->num_network_route_changes()); |
989 cricket::NetworkRoute expected_network_route(local_net_id, remote_net_id); | 990 cricket::NetworkRoute expected_network_route(local_net_id, remote_net_id, |
| 991 last_packet_id); |
990 EXPECT_EQ(expected_network_route, media_channel1->last_network_route()); | 992 EXPECT_EQ(expected_network_route, media_channel1->last_network_route()); |
| 993 EXPECT_EQ(last_packet_id, |
| 994 media_channel1->last_network_route().last_sent_packet_id); |
991 } | 995 } |
992 | 996 |
993 // Test setting up a call. | 997 // Test setting up a call. |
994 void TestCallSetup() { | 998 void TestCallSetup() { |
995 CreateChannels(0, 0); | 999 CreateChannels(0, 0); |
996 EXPECT_FALSE(channel1_->secure()); | 1000 EXPECT_FALSE(channel1_->secure()); |
997 EXPECT_TRUE(SendInitiate()); | 1001 EXPECT_TRUE(SendInitiate()); |
998 if (verify_playout_) { | 1002 if (verify_playout_) { |
999 EXPECT_TRUE(media_channel1_->playout()); | 1003 EXPECT_TRUE(media_channel1_->playout()); |
1000 } | 1004 } |
(...skipping 1817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2818 }; | 2822 }; |
2819 rtc::CopyOnWriteBuffer payload(data, 3); | 2823 rtc::CopyOnWriteBuffer payload(data, 3); |
2820 cricket::SendDataResult result; | 2824 cricket::SendDataResult result; |
2821 ASSERT_TRUE(media_channel1_->SendData(params, payload, &result)); | 2825 ASSERT_TRUE(media_channel1_->SendData(params, payload, &result)); |
2822 EXPECT_EQ(params.ssrc, | 2826 EXPECT_EQ(params.ssrc, |
2823 media_channel1_->last_sent_data_params().ssrc); | 2827 media_channel1_->last_sent_data_params().ssrc); |
2824 EXPECT_EQ("foo", media_channel1_->last_sent_data()); | 2828 EXPECT_EQ("foo", media_channel1_->last_sent_data()); |
2825 } | 2829 } |
2826 | 2830 |
2827 // TODO(pthatcher): TestSetReceiver? | 2831 // TODO(pthatcher): TestSetReceiver? |
OLD | NEW |