| 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 897 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 908 cricket::TransportChannel* transport_channel1 = | 908 cricket::TransportChannel* transport_channel1 = |
| 909 channel1_->transport_channel(); | 909 channel1_->transport_channel(); |
| 910 ASSERT_TRUE(transport_channel1); | 910 ASSERT_TRUE(transport_channel1); |
| 911 typename T::MediaChannel* media_channel1 = | 911 typename T::MediaChannel* media_channel1 = |
| 912 static_cast<typename T::MediaChannel*>(channel1_->media_channel()); | 912 static_cast<typename T::MediaChannel*>(channel1_->media_channel()); |
| 913 ASSERT_TRUE(media_channel1); | 913 ASSERT_TRUE(media_channel1); |
| 914 | 914 |
| 915 media_channel1->set_num_network_route_changes(0); | 915 media_channel1->set_num_network_route_changes(0); |
| 916 network_thread_->Invoke<void>(RTC_FROM_HERE, [transport_channel1] { | 916 network_thread_->Invoke<void>(RTC_FROM_HERE, [transport_channel1] { |
| 917 // The transport channel becomes disconnected. | 917 // The transport channel becomes disconnected. |
| 918 transport_channel1->SignalSelectedCandidatePairChanged(transport_channel1, | 918 transport_channel1->SignalSelectedCandidatePairChanged( |
| 919 nullptr, -1); | 919 transport_channel1, nullptr, -1, false); |
| 920 }); | 920 }); |
| 921 WaitForThreads(); | 921 WaitForThreads(); |
| 922 EXPECT_EQ(1, media_channel1->num_network_route_changes()); | 922 EXPECT_EQ(1, media_channel1->num_network_route_changes()); |
| 923 EXPECT_FALSE(media_channel1->last_network_route().connected); | 923 EXPECT_FALSE(media_channel1->last_network_route().connected); |
| 924 media_channel1->set_num_network_route_changes(0); | 924 media_channel1->set_num_network_route_changes(0); |
| 925 | 925 |
| 926 network_thread_->Invoke<void>(RTC_FROM_HERE, [this, transport_channel1, | 926 network_thread_->Invoke<void>(RTC_FROM_HERE, [this, transport_channel1, |
| 927 media_channel1, kLocalNetId, | 927 media_channel1, kLocalNetId, |
| 928 kRemoteNetId, kLastPacketId] { | 928 kRemoteNetId, kLastPacketId] { |
| 929 // The transport channel becomes connected. | 929 // The transport channel becomes connected. |
| 930 rtc::SocketAddress local_address("192.168.1.1", 1000 /* port number */); | 930 rtc::SocketAddress local_address("192.168.1.1", 1000 /* port number */); |
| 931 rtc::SocketAddress remote_address("192.168.1.2", 2000 /* port number */); | 931 rtc::SocketAddress remote_address("192.168.1.2", 2000 /* port number */); |
| 932 std::unique_ptr<cricket::CandidatePairInterface> candidate_pair( | 932 std::unique_ptr<cricket::CandidatePairInterface> candidate_pair( |
| 933 transport_controller1_->CreateFakeCandidatePair( | 933 transport_controller1_->CreateFakeCandidatePair( |
| 934 local_address, kLocalNetId, remote_address, kRemoteNetId)); | 934 local_address, kLocalNetId, remote_address, kRemoteNetId)); |
| 935 transport_channel1->SignalSelectedCandidatePairChanged( | 935 transport_channel1->SignalSelectedCandidatePairChanged( |
| 936 transport_channel1, candidate_pair.get(), kLastPacketId); | 936 transport_channel1, candidate_pair.get(), kLastPacketId, true); |
| 937 }); | 937 }); |
| 938 WaitForThreads(); | 938 WaitForThreads(); |
| 939 EXPECT_EQ(1, media_channel1->num_network_route_changes()); | 939 EXPECT_EQ(1, media_channel1->num_network_route_changes()); |
| 940 rtc::NetworkRoute expected_network_route(true, kLocalNetId, kRemoteNetId, | 940 rtc::NetworkRoute expected_network_route(true, kLocalNetId, kRemoteNetId, |
| 941 kLastPacketId); | 941 kLastPacketId); |
| 942 EXPECT_EQ(expected_network_route, media_channel1->last_network_route()); | 942 EXPECT_EQ(expected_network_route, media_channel1->last_network_route()); |
| 943 EXPECT_EQ(kLastPacketId, | 943 EXPECT_EQ(kLastPacketId, |
| 944 media_channel1->last_network_route().last_sent_packet_id); | 944 media_channel1->last_network_route().last_sent_packet_id); |
| 945 } | 945 } |
| 946 | 946 |
| (...skipping 2647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3594 }; | 3594 }; |
| 3595 rtc::CopyOnWriteBuffer payload(data, 3); | 3595 rtc::CopyOnWriteBuffer payload(data, 3); |
| 3596 cricket::SendDataResult result; | 3596 cricket::SendDataResult result; |
| 3597 ASSERT_TRUE(media_channel1_->SendData(params, payload, &result)); | 3597 ASSERT_TRUE(media_channel1_->SendData(params, payload, &result)); |
| 3598 EXPECT_EQ(params.ssrc, | 3598 EXPECT_EQ(params.ssrc, |
| 3599 media_channel1_->last_sent_data_params().ssrc); | 3599 media_channel1_->last_sent_data_params().ssrc); |
| 3600 EXPECT_EQ("foo", media_channel1_->last_sent_data()); | 3600 EXPECT_EQ("foo", media_channel1_->last_sent_data()); |
| 3601 } | 3601 } |
| 3602 | 3602 |
| 3603 // TODO(pthatcher): TestSetReceiver? | 3603 // TODO(pthatcher): TestSetReceiver? |
| OLD | NEW |