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 940 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
951 rtc::SocketAddress local_address("192.168.1.1", 1000 /* port number */); | 951 rtc::SocketAddress local_address("192.168.1.1", 1000 /* port number */); |
952 rtc::SocketAddress remote_address("192.168.1.2", 2000 /* port number */); | 952 rtc::SocketAddress remote_address("192.168.1.2", 2000 /* port number */); |
953 std::unique_ptr<cricket::CandidatePairInterface> candidate_pair( | 953 std::unique_ptr<cricket::CandidatePairInterface> candidate_pair( |
954 transport_controller1_->CreateFakeCandidatePair( | 954 transport_controller1_->CreateFakeCandidatePair( |
955 local_address, kLocalNetId, remote_address, kRemoteNetId)); | 955 local_address, kLocalNetId, remote_address, kRemoteNetId)); |
956 transport_channel1->SignalSelectedCandidatePairChanged( | 956 transport_channel1->SignalSelectedCandidatePairChanged( |
957 transport_channel1, candidate_pair.get(), kLastPacketId, true); | 957 transport_channel1, candidate_pair.get(), kLastPacketId, true); |
958 }); | 958 }); |
959 WaitForThreads(); | 959 WaitForThreads(); |
960 EXPECT_EQ(1, media_channel1->num_network_route_changes()); | 960 EXPECT_EQ(1, media_channel1->num_network_route_changes()); |
| 961 constexpr int kTransportOverheadPerPacket = 28; // Ipv4(20) + UDP(8). |
961 rtc::NetworkRoute expected_network_route(true, kLocalNetId, kRemoteNetId, | 962 rtc::NetworkRoute expected_network_route(true, kLocalNetId, kRemoteNetId, |
962 kLastPacketId); | 963 kLastPacketId, |
| 964 kTransportOverheadPerPacket); |
963 EXPECT_EQ(expected_network_route, media_channel1->last_network_route()); | 965 EXPECT_EQ(expected_network_route, media_channel1->last_network_route()); |
964 EXPECT_EQ(kLastPacketId, | 966 EXPECT_EQ(kLastPacketId, |
965 media_channel1->last_network_route().last_sent_packet_id); | 967 media_channel1->last_network_route().last_sent_packet_id); |
| 968 EXPECT_EQ( |
| 969 kTransportOverheadPerPacket, |
| 970 media_channel1->last_network_route().transport_overhead_per_packet); |
966 } | 971 } |
967 | 972 |
968 // Test setting up a call. | 973 // Test setting up a call. |
969 void TestCallSetup() { | 974 void TestCallSetup() { |
970 CreateChannels(0, 0); | 975 CreateChannels(0, 0); |
971 EXPECT_FALSE(channel1_->secure()); | 976 EXPECT_FALSE(channel1_->secure()); |
972 EXPECT_TRUE(SendInitiate()); | 977 EXPECT_TRUE(SendInitiate()); |
973 if (verify_playout_) { | 978 if (verify_playout_) { |
974 EXPECT_TRUE(media_channel1_->playout()); | 979 EXPECT_TRUE(media_channel1_->playout()); |
975 } | 980 } |
(...skipping 2701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3677 }; | 3682 }; |
3678 rtc::CopyOnWriteBuffer payload(data, 3); | 3683 rtc::CopyOnWriteBuffer payload(data, 3); |
3679 cricket::SendDataResult result; | 3684 cricket::SendDataResult result; |
3680 ASSERT_TRUE(media_channel1_->SendData(params, payload, &result)); | 3685 ASSERT_TRUE(media_channel1_->SendData(params, payload, &result)); |
3681 EXPECT_EQ(params.ssrc, | 3686 EXPECT_EQ(params.ssrc, |
3682 media_channel1_->last_sent_data_params().ssrc); | 3687 media_channel1_->last_sent_data_params().ssrc); |
3683 EXPECT_EQ("foo", media_channel1_->last_sent_data()); | 3688 EXPECT_EQ("foo", media_channel1_->last_sent_data()); |
3684 } | 3689 } |
3685 | 3690 |
3686 // TODO(pthatcher): TestSetReceiver? | 3691 // TODO(pthatcher): TestSetReceiver? |
OLD | NEW |