Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(92)

Side by Side Diff: talk/session/media/channel_unittest.cc

Issue 1334793003: Remove VideoMediaChannel::SetRender(). (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: remove IsReadyToReceive from logging Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « talk/session/media/channel.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * libjingle 2 * libjingle
3 * Copyright 2009 Google Inc. 3 * Copyright 2009 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 rtc::Pathname(path), "wb"); 119 rtc::Pathname(path), "wb");
120 } 120 }
121 121
122 // Base class for Voice/VideoChannel tests 122 // Base class for Voice/VideoChannel tests
123 template<class T> 123 template<class T>
124 class ChannelTest : public testing::Test, public sigslot::has_slots<> { 124 class ChannelTest : public testing::Test, public sigslot::has_slots<> {
125 public: 125 public:
126 enum Flags { RTCP = 0x1, RTCP_MUX = 0x2, SECURE = 0x4, SSRC_MUX = 0x8, 126 enum Flags { RTCP = 0x1, RTCP_MUX = 0x2, SECURE = 0x4, SSRC_MUX = 0x8,
127 DTLS = 0x10 }; 127 DTLS = 0x10 };
128 128
129 ChannelTest(const uint8* rtp_data, 129 ChannelTest(bool verify_playout,
130 const uint8* rtp_data,
130 int rtp_len, 131 int rtp_len,
131 const uint8* rtcp_data, 132 const uint8* rtcp_data,
132 int rtcp_len) 133 int rtcp_len)
133 : transport_controller1_(cricket::ICEROLE_CONTROLLING), 134 : verify_playout_(verify_playout),
135 transport_controller1_(cricket::ICEROLE_CONTROLLING),
134 transport_controller2_(cricket::ICEROLE_CONTROLLED), 136 transport_controller2_(cricket::ICEROLE_CONTROLLED),
135 media_channel1_(NULL), 137 media_channel1_(NULL),
136 media_channel2_(NULL), 138 media_channel2_(NULL),
137 rtp_packet_(reinterpret_cast<const char*>(rtp_data), rtp_len), 139 rtp_packet_(reinterpret_cast<const char*>(rtp_data), rtp_len),
138 rtcp_packet_(reinterpret_cast<const char*>(rtcp_data), rtcp_len), 140 rtcp_packet_(reinterpret_cast<const char*>(rtcp_data), rtcp_len),
139 media_info_callbacks1_(), 141 media_info_callbacks1_(),
140 media_info_callbacks2_(), 142 media_info_callbacks2_(),
141 ssrc_(0), 143 ssrc_(0),
142 error_(T::MediaChannel::ERROR_NONE) {} 144 error_(T::MediaChannel::ERROR_NONE) {}
143 145
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 // Base implementation. 484 // Base implementation.
483 } 485 }
484 486
485 // Tests that can be used by derived classes. 487 // Tests that can be used by derived classes.
486 488
487 // Basic sanity check. 489 // Basic sanity check.
488 void TestInit() { 490 void TestInit() {
489 CreateChannels(0, 0); 491 CreateChannels(0, 0);
490 EXPECT_FALSE(channel1_->secure()); 492 EXPECT_FALSE(channel1_->secure());
491 EXPECT_FALSE(media_channel1_->sending()); 493 EXPECT_FALSE(media_channel1_->sending());
492 EXPECT_FALSE(media_channel1_->playout()); 494 if (verify_playout_)
pthatcher1 2015/09/24 16:46:52 {}s
pbos-webrtc 2015/09/24 16:53:44 Done, woo!
495 EXPECT_FALSE(media_channel1_->playout());
493 EXPECT_TRUE(media_channel1_->codecs().empty()); 496 EXPECT_TRUE(media_channel1_->codecs().empty());
494 EXPECT_TRUE(media_channel1_->recv_streams().empty()); 497 EXPECT_TRUE(media_channel1_->recv_streams().empty());
495 EXPECT_TRUE(media_channel1_->rtp_packets().empty()); 498 EXPECT_TRUE(media_channel1_->rtp_packets().empty());
496 EXPECT_TRUE(media_channel1_->rtcp_packets().empty()); 499 EXPECT_TRUE(media_channel1_->rtcp_packets().empty());
497 } 500 }
498 501
499 // Test that SetLocalContent and SetRemoteContent properly configure 502 // Test that SetLocalContent and SetRemoteContent properly configure
500 // the codecs. 503 // the codecs.
501 void TestSetContents() { 504 void TestSetContents() {
502 CreateChannels(0, 0); 505 CreateChannels(0, 0);
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
809 812
810 EXPECT_TRUE(channel1_->secure()); 813 EXPECT_TRUE(channel1_->secure());
811 EXPECT_TRUE(channel2_->secure()); 814 EXPECT_TRUE(channel2_->secure());
812 EXPECT_TRUE(SendCustomRtp2(kSsrc2, 0)); 815 EXPECT_TRUE(SendCustomRtp2(kSsrc2, 0));
813 EXPECT_TRUE(CheckCustomRtp1(kSsrc2, 0)); 816 EXPECT_TRUE(CheckCustomRtp1(kSsrc2, 0));
814 } 817 }
815 818
816 // Test that we only start playout and sending at the right times. 819 // Test that we only start playout and sending at the right times.
817 void TestPlayoutAndSendingStates() { 820 void TestPlayoutAndSendingStates() {
818 CreateChannels(0, 0); 821 CreateChannels(0, 0);
819 EXPECT_FALSE(media_channel1_->playout()); 822 if (verify_playout_)
823 EXPECT_FALSE(media_channel1_->playout());
820 EXPECT_FALSE(media_channel1_->sending()); 824 EXPECT_FALSE(media_channel1_->sending());
821 EXPECT_FALSE(media_channel2_->playout()); 825 if (verify_playout_)
826 EXPECT_FALSE(media_channel2_->playout());
822 EXPECT_FALSE(media_channel2_->sending()); 827 EXPECT_FALSE(media_channel2_->sending());
823 EXPECT_TRUE(channel1_->Enable(true)); 828 EXPECT_TRUE(channel1_->Enable(true));
824 EXPECT_FALSE(media_channel1_->playout()); 829 if (verify_playout_)
830 EXPECT_FALSE(media_channel1_->playout());
825 EXPECT_FALSE(media_channel1_->sending()); 831 EXPECT_FALSE(media_channel1_->sending());
826 EXPECT_TRUE(channel1_->SetLocalContent(&local_media_content1_, 832 EXPECT_TRUE(channel1_->SetLocalContent(&local_media_content1_,
827 CA_OFFER, NULL)); 833 CA_OFFER, NULL));
828 EXPECT_TRUE(media_channel1_->playout()); 834 if (verify_playout_)
835 EXPECT_TRUE(media_channel1_->playout());
829 EXPECT_FALSE(media_channel1_->sending()); 836 EXPECT_FALSE(media_channel1_->sending());
830 EXPECT_TRUE(channel2_->SetRemoteContent(&local_media_content1_, 837 EXPECT_TRUE(channel2_->SetRemoteContent(&local_media_content1_,
831 CA_OFFER, NULL)); 838 CA_OFFER, NULL));
832 EXPECT_FALSE(media_channel2_->playout()); 839 if (verify_playout_)
840 EXPECT_FALSE(media_channel2_->playout());
833 EXPECT_FALSE(media_channel2_->sending()); 841 EXPECT_FALSE(media_channel2_->sending());
834 EXPECT_TRUE(channel2_->SetLocalContent(&local_media_content2_, 842 EXPECT_TRUE(channel2_->SetLocalContent(&local_media_content2_,
835 CA_ANSWER, NULL)); 843 CA_ANSWER, NULL));
836 EXPECT_FALSE(media_channel2_->playout()); 844 if (verify_playout_)
845 EXPECT_FALSE(media_channel2_->playout());
837 EXPECT_FALSE(media_channel2_->sending()); 846 EXPECT_FALSE(media_channel2_->sending());
838 transport_controller1_.Connect(&transport_controller2_); 847 transport_controller1_.Connect(&transport_controller2_);
839 EXPECT_TRUE(media_channel1_->playout()); 848 if (verify_playout_)
849 EXPECT_TRUE(media_channel1_->playout());
840 EXPECT_FALSE(media_channel1_->sending()); 850 EXPECT_FALSE(media_channel1_->sending());
841 EXPECT_FALSE(media_channel2_->playout()); 851 if (verify_playout_)
852 EXPECT_FALSE(media_channel2_->playout());
842 EXPECT_FALSE(media_channel2_->sending()); 853 EXPECT_FALSE(media_channel2_->sending());
843 EXPECT_TRUE(channel2_->Enable(true)); 854 EXPECT_TRUE(channel2_->Enable(true));
844 EXPECT_TRUE(media_channel2_->playout()); 855 if (verify_playout_)
856 EXPECT_TRUE(media_channel2_->playout());
845 EXPECT_TRUE(media_channel2_->sending()); 857 EXPECT_TRUE(media_channel2_->sending());
846 EXPECT_TRUE(channel1_->SetRemoteContent(&local_media_content2_, 858 EXPECT_TRUE(channel1_->SetRemoteContent(&local_media_content2_,
847 CA_ANSWER, NULL)); 859 CA_ANSWER, NULL));
848 EXPECT_TRUE(media_channel1_->playout()); 860 if (verify_playout_)
861 EXPECT_TRUE(media_channel1_->playout());
849 EXPECT_TRUE(media_channel1_->sending()); 862 EXPECT_TRUE(media_channel1_->sending());
850 } 863 }
851 864
852 // Test that changing the MediaContentDirection in the local and remote 865 // Test that changing the MediaContentDirection in the local and remote
853 // session description start playout and sending at the right time. 866 // session description start playout and sending at the right time.
854 void TestMediaContentDirection() { 867 void TestMediaContentDirection() {
855 CreateChannels(0, 0); 868 CreateChannels(0, 0);
856 typename T::Content content1; 869 typename T::Content content1;
857 CreateContent(0, kPcmuCodec, kH264Codec, &content1); 870 CreateContent(0, kPcmuCodec, kH264Codec, &content1);
858 typename T::Content content2; 871 typename T::Content content2;
859 CreateContent(0, kPcmuCodec, kH264Codec, &content2); 872 CreateContent(0, kPcmuCodec, kH264Codec, &content2);
860 // Set |content2| to be InActive. 873 // Set |content2| to be InActive.
861 content2.set_direction(cricket::MD_INACTIVE); 874 content2.set_direction(cricket::MD_INACTIVE);
862 875
863 EXPECT_TRUE(channel1_->Enable(true)); 876 EXPECT_TRUE(channel1_->Enable(true));
864 EXPECT_TRUE(channel2_->Enable(true)); 877 EXPECT_TRUE(channel2_->Enable(true));
865 EXPECT_FALSE(media_channel1_->playout()); 878 if (verify_playout_)
879 EXPECT_FALSE(media_channel1_->playout());
866 EXPECT_FALSE(media_channel1_->sending()); 880 EXPECT_FALSE(media_channel1_->sending());
867 EXPECT_FALSE(media_channel2_->playout()); 881 if (verify_playout_)
882 EXPECT_FALSE(media_channel2_->playout());
868 EXPECT_FALSE(media_channel2_->sending()); 883 EXPECT_FALSE(media_channel2_->sending());
869 884
870 EXPECT_TRUE(channel1_->SetLocalContent(&content1, CA_OFFER, NULL)); 885 EXPECT_TRUE(channel1_->SetLocalContent(&content1, CA_OFFER, NULL));
871 EXPECT_TRUE(channel2_->SetRemoteContent(&content1, CA_OFFER, NULL)); 886 EXPECT_TRUE(channel2_->SetRemoteContent(&content1, CA_OFFER, NULL));
872 EXPECT_TRUE(channel2_->SetLocalContent(&content2, CA_PRANSWER, NULL)); 887 EXPECT_TRUE(channel2_->SetLocalContent(&content2, CA_PRANSWER, NULL));
873 EXPECT_TRUE(channel1_->SetRemoteContent(&content2, CA_PRANSWER, NULL)); 888 EXPECT_TRUE(channel1_->SetRemoteContent(&content2, CA_PRANSWER, NULL));
874 transport_controller1_.Connect(&transport_controller2_); 889 transport_controller1_.Connect(&transport_controller2_);
875 890
876 EXPECT_TRUE(media_channel1_->playout()); 891 if (verify_playout_)
892 EXPECT_TRUE(media_channel1_->playout());
877 EXPECT_FALSE(media_channel1_->sending()); // remote InActive 893 EXPECT_FALSE(media_channel1_->sending()); // remote InActive
878 EXPECT_FALSE(media_channel2_->playout()); // local InActive 894 if (verify_playout_)
895 EXPECT_FALSE(media_channel2_->playout()); // local InActive
879 EXPECT_FALSE(media_channel2_->sending()); // local InActive 896 EXPECT_FALSE(media_channel2_->sending()); // local InActive
880 897
881 // Update |content2| to be RecvOnly. 898 // Update |content2| to be RecvOnly.
882 content2.set_direction(cricket::MD_RECVONLY); 899 content2.set_direction(cricket::MD_RECVONLY);
883 EXPECT_TRUE(channel2_->SetLocalContent(&content2, CA_PRANSWER, NULL)); 900 EXPECT_TRUE(channel2_->SetLocalContent(&content2, CA_PRANSWER, NULL));
884 EXPECT_TRUE(channel1_->SetRemoteContent(&content2, CA_PRANSWER, NULL)); 901 EXPECT_TRUE(channel1_->SetRemoteContent(&content2, CA_PRANSWER, NULL));
885 902
886 EXPECT_TRUE(media_channel1_->playout()); 903 if (verify_playout_)
904 EXPECT_TRUE(media_channel1_->playout());
887 EXPECT_TRUE(media_channel1_->sending()); 905 EXPECT_TRUE(media_channel1_->sending());
888 EXPECT_TRUE(media_channel2_->playout()); // local RecvOnly 906 if (verify_playout_)
907 EXPECT_TRUE(media_channel2_->playout()); // local RecvOnly
889 EXPECT_FALSE(media_channel2_->sending()); // local RecvOnly 908 EXPECT_FALSE(media_channel2_->sending()); // local RecvOnly
890 909
891 // Update |content2| to be SendRecv. 910 // Update |content2| to be SendRecv.
892 content2.set_direction(cricket::MD_SENDRECV); 911 content2.set_direction(cricket::MD_SENDRECV);
893 EXPECT_TRUE(channel2_->SetLocalContent(&content2, CA_ANSWER, NULL)); 912 EXPECT_TRUE(channel2_->SetLocalContent(&content2, CA_ANSWER, NULL));
894 EXPECT_TRUE(channel1_->SetRemoteContent(&content2, CA_ANSWER, NULL)); 913 EXPECT_TRUE(channel1_->SetRemoteContent(&content2, CA_ANSWER, NULL));
895 914
896 EXPECT_TRUE(media_channel1_->playout()); 915 if (verify_playout_)
916 EXPECT_TRUE(media_channel1_->playout());
897 EXPECT_TRUE(media_channel1_->sending()); 917 EXPECT_TRUE(media_channel1_->sending());
898 EXPECT_TRUE(media_channel2_->playout()); 918 if (verify_playout_)
919 EXPECT_TRUE(media_channel2_->playout());
899 EXPECT_TRUE(media_channel2_->sending()); 920 EXPECT_TRUE(media_channel2_->sending());
900 } 921 }
901 922
902 // Test setting up a call. 923 // Test setting up a call.
903 void TestCallSetup() { 924 void TestCallSetup() {
904 CreateChannels(0, 0); 925 CreateChannels(0, 0);
905 EXPECT_FALSE(channel1_->secure()); 926 EXPECT_FALSE(channel1_->secure());
906 EXPECT_TRUE(SendInitiate()); 927 EXPECT_TRUE(SendInitiate());
907 EXPECT_TRUE(media_channel1_->playout()); 928 if (verify_playout_)
929 EXPECT_TRUE(media_channel1_->playout());
908 EXPECT_FALSE(media_channel1_->sending()); 930 EXPECT_FALSE(media_channel1_->sending());
909 EXPECT_TRUE(SendAccept()); 931 EXPECT_TRUE(SendAccept());
910 EXPECT_FALSE(channel1_->secure()); 932 EXPECT_FALSE(channel1_->secure());
911 EXPECT_TRUE(media_channel1_->sending()); 933 EXPECT_TRUE(media_channel1_->sending());
912 EXPECT_EQ(1U, media_channel1_->codecs().size()); 934 EXPECT_EQ(1U, media_channel1_->codecs().size());
913 EXPECT_TRUE(media_channel2_->playout()); 935 if (verify_playout_)
936 EXPECT_TRUE(media_channel2_->playout());
914 EXPECT_TRUE(media_channel2_->sending()); 937 EXPECT_TRUE(media_channel2_->sending());
915 EXPECT_EQ(1U, media_channel2_->codecs().size()); 938 EXPECT_EQ(1U, media_channel2_->codecs().size());
916 } 939 }
917 940
918 // Test that we don't crash if packets are sent during call teardown 941 // Test that we don't crash if packets are sent during call teardown
919 // when RTCP mux is enabled. This is a regression test against a specific 942 // when RTCP mux is enabled. This is a regression test against a specific
920 // race condition that would only occur when a RTCP packet was sent during 943 // race condition that would only occur when a RTCP packet was sent during
921 // teardown of a channel on which RTCP mux was enabled. 944 // teardown of a channel on which RTCP mux was enabled.
922 void TestCallTeardownRtcpMux() { 945 void TestCallTeardownRtcpMux() {
923 class LastWordMediaChannel : public T::MediaChannel { 946 class LastWordMediaChannel : public T::MediaChannel {
(...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after
1731 EXPECT_FALSE(media_channel1_->ready_to_send()); 1754 EXPECT_FALSE(media_channel1_->ready_to_send());
1732 // In the case of rtcp mux, the SignalReadyToSend() from rtp channel 1755 // In the case of rtcp mux, the SignalReadyToSend() from rtp channel
1733 // should trigger the MediaChannel's OnReadyToSend. 1756 // should trigger the MediaChannel's OnReadyToSend.
1734 rtp->SignalReadyToSend(rtp); 1757 rtp->SignalReadyToSend(rtp);
1735 EXPECT_TRUE(media_channel1_->ready_to_send()); 1758 EXPECT_TRUE(media_channel1_->ready_to_send());
1736 channel1_->SetReadyToSend(false, false); 1759 channel1_->SetReadyToSend(false, false);
1737 EXPECT_FALSE(media_channel1_->ready_to_send()); 1760 EXPECT_FALSE(media_channel1_->ready_to_send());
1738 } 1761 }
1739 1762
1740 protected: 1763 protected:
1764 // TODO(pbos): Remove playout from media engines, muting should be controlled
1765 // by the renderer.
1766 const bool verify_playout_;
1741 cricket::FakeTransportController transport_controller1_; 1767 cricket::FakeTransportController transport_controller1_;
1742 cricket::FakeTransportController transport_controller2_; 1768 cricket::FakeTransportController transport_controller2_;
1743 cricket::FakeMediaEngine media_engine_; 1769 cricket::FakeMediaEngine media_engine_;
1744 // The media channels are owned by the voice channel objects below. 1770 // The media channels are owned by the voice channel objects below.
1745 typename T::MediaChannel* media_channel1_; 1771 typename T::MediaChannel* media_channel1_;
1746 typename T::MediaChannel* media_channel2_; 1772 typename T::MediaChannel* media_channel2_;
1747 rtc::scoped_ptr<typename T::Channel> channel1_; 1773 rtc::scoped_ptr<typename T::Channel> channel1_;
1748 rtc::scoped_ptr<typename T::Channel> channel2_; 1774 rtc::scoped_ptr<typename T::Channel> channel2_;
1749 typename T::Content local_media_content1_; 1775 typename T::Content local_media_content1_;
1750 typename T::Content local_media_content2_; 1776 typename T::Content local_media_content2_;
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
1794 void ChannelTest<VoiceTraits>::AddLegacyStreamInContent( 1820 void ChannelTest<VoiceTraits>::AddLegacyStreamInContent(
1795 uint32 ssrc, int flags, cricket::AudioContentDescription* audio) { 1821 uint32 ssrc, int flags, cricket::AudioContentDescription* audio) {
1796 audio->AddLegacyStream(ssrc); 1822 audio->AddLegacyStream(ssrc);
1797 } 1823 }
1798 1824
1799 class VoiceChannelTest 1825 class VoiceChannelTest
1800 : public ChannelTest<VoiceTraits> { 1826 : public ChannelTest<VoiceTraits> {
1801 public: 1827 public:
1802 typedef ChannelTest<VoiceTraits> Base; 1828 typedef ChannelTest<VoiceTraits> Base;
1803 VoiceChannelTest() 1829 VoiceChannelTest()
1804 : Base(kPcmuFrame, sizeof(kPcmuFrame), kRtcpReport, sizeof(kRtcpReport)) { 1830 : Base(true,
1805 } 1831 kPcmuFrame,
1832 sizeof(kPcmuFrame),
1833 kRtcpReport,
1834 sizeof(kRtcpReport)) {}
1806 }; 1835 };
1807 1836
1808 // override to add NULL parameter 1837 // override to add NULL parameter
1809 template <> 1838 template <>
1810 cricket::VideoChannel* ChannelTest<VideoTraits>::CreateChannel( 1839 cricket::VideoChannel* ChannelTest<VideoTraits>::CreateChannel(
1811 rtc::Thread* thread, 1840 rtc::Thread* thread,
1812 cricket::MediaEngineInterface* engine, 1841 cricket::MediaEngineInterface* engine,
1813 cricket::FakeVideoMediaChannel* ch, 1842 cricket::FakeVideoMediaChannel* ch,
1814 cricket::TransportController* transport_controller, 1843 cricket::TransportController* transport_controller,
1815 bool rtcp) { 1844 bool rtcp) {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
1861 void ChannelTest<VideoTraits>::AddLegacyStreamInContent( 1890 void ChannelTest<VideoTraits>::AddLegacyStreamInContent(
1862 uint32 ssrc, int flags, cricket::VideoContentDescription* video) { 1891 uint32 ssrc, int flags, cricket::VideoContentDescription* video) {
1863 video->AddLegacyStream(ssrc); 1892 video->AddLegacyStream(ssrc);
1864 } 1893 }
1865 1894
1866 class VideoChannelTest 1895 class VideoChannelTest
1867 : public ChannelTest<VideoTraits> { 1896 : public ChannelTest<VideoTraits> {
1868 public: 1897 public:
1869 typedef ChannelTest<VideoTraits> Base; 1898 typedef ChannelTest<VideoTraits> Base;
1870 VideoChannelTest() 1899 VideoChannelTest()
1871 : Base(kH264Packet, 1900 : Base(false,
1901 kH264Packet,
1872 sizeof(kH264Packet), 1902 sizeof(kH264Packet),
1873 kRtcpReport, 1903 kRtcpReport,
1874 sizeof(kRtcpReport)) {} 1904 sizeof(kRtcpReport)) {}
1875 }; 1905 };
1876 1906
1877 1907
1878 // VoiceChannelTest 1908 // VoiceChannelTest
1879 1909
1880 TEST_F(VoiceChannelTest, TestInit) { 1910 TEST_F(VoiceChannelTest, TestInit) {
1881 Base::TestInit(); 1911 Base::TestInit();
(...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after
2549 } 2579 }
2550 2580
2551 2581
2552 // DataChannelTest 2582 // DataChannelTest
2553 2583
2554 class DataChannelTest 2584 class DataChannelTest
2555 : public ChannelTest<DataTraits> { 2585 : public ChannelTest<DataTraits> {
2556 public: 2586 public:
2557 typedef ChannelTest<DataTraits> 2587 typedef ChannelTest<DataTraits>
2558 Base; 2588 Base;
2559 DataChannelTest() : Base(kDataPacket, sizeof(kDataPacket), 2589 DataChannelTest()
2560 kRtcpReport, sizeof(kRtcpReport)) { 2590 : Base(true,
2561 } 2591 kDataPacket,
2592 sizeof(kDataPacket),
2593 kRtcpReport,
2594 sizeof(kRtcpReport)) {}
2562 }; 2595 };
2563 2596
2564 // Override to avoid engine channel parameter. 2597 // Override to avoid engine channel parameter.
2565 template <> 2598 template <>
2566 cricket::DataChannel* ChannelTest<DataTraits>::CreateChannel( 2599 cricket::DataChannel* ChannelTest<DataTraits>::CreateChannel(
2567 rtc::Thread* thread, 2600 rtc::Thread* thread,
2568 cricket::MediaEngineInterface* engine, 2601 cricket::MediaEngineInterface* engine,
2569 cricket::FakeDataMediaChannel* ch, 2602 cricket::FakeDataMediaChannel* ch,
2570 cricket::TransportController* transport_controller, 2603 cricket::TransportController* transport_controller,
2571 bool rtcp) { 2604 bool rtcp) {
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
2749 }; 2782 };
2750 rtc::Buffer payload(data, 3); 2783 rtc::Buffer payload(data, 3);
2751 cricket::SendDataResult result; 2784 cricket::SendDataResult result;
2752 ASSERT_TRUE(media_channel1_->SendData(params, payload, &result)); 2785 ASSERT_TRUE(media_channel1_->SendData(params, payload, &result));
2753 EXPECT_EQ(params.ssrc, 2786 EXPECT_EQ(params.ssrc,
2754 media_channel1_->last_sent_data_params().ssrc); 2787 media_channel1_->last_sent_data_params().ssrc);
2755 EXPECT_EQ("foo", media_channel1_->last_sent_data()); 2788 EXPECT_EQ("foo", media_channel1_->last_sent_data());
2756 } 2789 }
2757 2790
2758 // TODO(pthatcher): TestSetReceiver? 2791 // TODO(pthatcher): TestSetReceiver?
OLDNEW
« no previous file with comments | « talk/session/media/channel.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698