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 933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
944 EXPECT_FALSE(media_channel1->last_network_route().connected); | 944 EXPECT_FALSE(media_channel1->last_network_route().connected); |
945 media_channel1->set_num_network_route_changes(0); | 945 media_channel1->set_num_network_route_changes(0); |
946 | 946 |
947 network_thread_->Invoke<void>(RTC_FROM_HERE, [this, transport_channel1, | 947 network_thread_->Invoke<void>(RTC_FROM_HERE, [this, transport_channel1, |
948 media_channel1, kLocalNetId, | 948 media_channel1, kLocalNetId, |
949 kRemoteNetId, kLastPacketId] { | 949 kRemoteNetId, kLastPacketId] { |
950 // The transport channel becomes connected. | 950 // The transport channel becomes connected. |
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_->CreateCandidatePair( |
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 rtc::NetworkRoute expected_network_route(true, kLocalNetId, kRemoteNetId, | 961 rtc::NetworkRoute expected_network_route(true, kLocalNetId, kRemoteNetId, |
962 kLastPacketId); | 962 kLastPacketId); |
963 EXPECT_EQ(expected_network_route, media_channel1->last_network_route()); | 963 EXPECT_EQ(expected_network_route, media_channel1->last_network_route()); |
964 EXPECT_EQ(kLastPacketId, | 964 EXPECT_EQ(kLastPacketId, |
965 media_channel1->last_network_route().last_sent_packet_id); | 965 media_channel1->last_network_route().last_sent_packet_id); |
| 966 constexpr int kTransportOverheadPerPacket = 28; // Ipv4(20) + UDP(8). |
| 967 EXPECT_EQ(kTransportOverheadPerPacket, |
| 968 media_channel1->transport_overhead_per_packet()); |
966 } | 969 } |
967 | 970 |
968 // Test setting up a call. | 971 // Test setting up a call. |
969 void TestCallSetup() { | 972 void TestCallSetup() { |
970 CreateChannels(0, 0); | 973 CreateChannels(0, 0); |
971 EXPECT_FALSE(channel1_->secure()); | 974 EXPECT_FALSE(channel1_->secure()); |
972 EXPECT_TRUE(SendInitiate()); | 975 EXPECT_TRUE(SendInitiate()); |
973 if (verify_playout_) { | 976 if (verify_playout_) { |
974 EXPECT_TRUE(media_channel1_->playout()); | 977 EXPECT_TRUE(media_channel1_->playout()); |
975 } | 978 } |
(...skipping 2701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3677 }; | 3680 }; |
3678 rtc::CopyOnWriteBuffer payload(data, 3); | 3681 rtc::CopyOnWriteBuffer payload(data, 3); |
3679 cricket::SendDataResult result; | 3682 cricket::SendDataResult result; |
3680 ASSERT_TRUE(media_channel1_->SendData(params, payload, &result)); | 3683 ASSERT_TRUE(media_channel1_->SendData(params, payload, &result)); |
3681 EXPECT_EQ(params.ssrc, | 3684 EXPECT_EQ(params.ssrc, |
3682 media_channel1_->last_sent_data_params().ssrc); | 3685 media_channel1_->last_sent_data_params().ssrc); |
3683 EXPECT_EQ("foo", media_channel1_->last_sent_data()); | 3686 EXPECT_EQ("foo", media_channel1_->last_sent_data()); |
3684 } | 3687 } |
3685 | 3688 |
3686 // TODO(pthatcher): TestSetReceiver? | 3689 // TODO(pthatcher): TestSetReceiver? |
OLD | NEW |