OLD | NEW |
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 1830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1841 void TestSetChannelOptions() { | 1841 void TestSetChannelOptions() { |
1842 CreateChannels(0, 0); | 1842 CreateChannels(0, 0); |
1843 | 1843 |
1844 cricket::AudioOptions options1; | 1844 cricket::AudioOptions options1; |
1845 options1.echo_cancellation.Set(false); | 1845 options1.echo_cancellation.Set(false); |
1846 cricket::AudioOptions options2; | 1846 cricket::AudioOptions options2; |
1847 options2.echo_cancellation.Set(true); | 1847 options2.echo_cancellation.Set(true); |
1848 | 1848 |
1849 channel1_->SetChannelOptions(options1); | 1849 channel1_->SetChannelOptions(options1); |
1850 channel2_->SetChannelOptions(options1); | 1850 channel2_->SetChannelOptions(options1); |
1851 cricket::AudioOptions actual_options; | 1851 EXPECT_EQ(options1, media_channel1_->options()); |
1852 ASSERT_TRUE(media_channel1_->GetOptions(&actual_options)); | 1852 EXPECT_EQ(options1, media_channel2_->options()); |
1853 EXPECT_EQ(options1, actual_options); | |
1854 ASSERT_TRUE(media_channel2_->GetOptions(&actual_options)); | |
1855 EXPECT_EQ(options1, actual_options); | |
1856 | 1853 |
1857 channel1_->SetChannelOptions(options2); | 1854 channel1_->SetChannelOptions(options2); |
1858 channel2_->SetChannelOptions(options2); | 1855 channel2_->SetChannelOptions(options2); |
1859 ASSERT_TRUE(media_channel1_->GetOptions(&actual_options)); | 1856 EXPECT_EQ(options2, media_channel1_->options()); |
1860 EXPECT_EQ(options2, actual_options); | 1857 EXPECT_EQ(options2, media_channel2_->options()); |
1861 ASSERT_TRUE(media_channel2_->GetOptions(&actual_options)); | |
1862 EXPECT_EQ(options2, actual_options); | |
1863 } | 1858 } |
1864 }; | 1859 }; |
1865 | 1860 |
1866 // override to add NULL parameter | 1861 // override to add NULL parameter |
1867 template<> | 1862 template<> |
1868 cricket::VideoChannel* ChannelTest<VideoTraits>::CreateChannel( | 1863 cricket::VideoChannel* ChannelTest<VideoTraits>::CreateChannel( |
1869 rtc::Thread* thread, cricket::MediaEngineInterface* engine, | 1864 rtc::Thread* thread, cricket::MediaEngineInterface* engine, |
1870 cricket::FakeVideoMediaChannel* ch, cricket::BaseSession* session, | 1865 cricket::FakeVideoMediaChannel* ch, cricket::BaseSession* session, |
1871 bool rtcp) { | 1866 bool rtcp) { |
1872 cricket::VideoChannel* channel = new cricket::VideoChannel( | 1867 cricket::VideoChannel* channel = new cricket::VideoChannel( |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1924 public: | 1919 public: |
1925 typedef ChannelTest<VideoTraits> | 1920 typedef ChannelTest<VideoTraits> |
1926 Base; | 1921 Base; |
1927 VideoChannelTest() : Base(kH264Packet, sizeof(kH264Packet), | 1922 VideoChannelTest() : Base(kH264Packet, sizeof(kH264Packet), |
1928 kRtcpReport, sizeof(kRtcpReport)) { | 1923 kRtcpReport, sizeof(kRtcpReport)) { |
1929 } | 1924 } |
1930 | 1925 |
1931 void TestSetChannelOptions() { | 1926 void TestSetChannelOptions() { |
1932 CreateChannels(0, 0); | 1927 CreateChannels(0, 0); |
1933 | 1928 |
1934 cricket::VideoOptions o1, o2; | 1929 cricket::VideoOptions o1; |
1935 o1.video_noise_reduction.Set(true); | 1930 o1.video_noise_reduction.Set(true); |
1936 | 1931 |
1937 channel1_->SetChannelOptions(o1); | 1932 channel1_->SetChannelOptions(o1); |
1938 channel2_->SetChannelOptions(o1); | 1933 channel2_->SetChannelOptions(o1); |
1939 EXPECT_TRUE(media_channel1_->GetOptions(&o2)); | 1934 EXPECT_EQ(o1, media_channel1_->options()); |
1940 EXPECT_EQ(o1, o2); | 1935 EXPECT_EQ(o1, media_channel2_->options()); |
1941 EXPECT_TRUE(media_channel2_->GetOptions(&o2)); | |
1942 EXPECT_EQ(o1, o2); | |
1943 | 1936 |
1944 o1.video_start_bitrate.Set(123); | 1937 o1.video_start_bitrate.Set(123); |
1945 channel1_->SetChannelOptions(o1); | 1938 channel1_->SetChannelOptions(o1); |
1946 channel2_->SetChannelOptions(o1); | 1939 channel2_->SetChannelOptions(o1); |
1947 EXPECT_TRUE(media_channel1_->GetOptions(&o2)); | 1940 EXPECT_EQ(o1, media_channel1_->options()); |
1948 EXPECT_EQ(o1, o2); | 1941 EXPECT_EQ(o1, media_channel2_->options()); |
1949 EXPECT_TRUE(media_channel2_->GetOptions(&o2)); | |
1950 EXPECT_EQ(o1, o2); | |
1951 } | 1942 } |
1952 }; | 1943 }; |
1953 | 1944 |
1954 | 1945 |
1955 // VoiceChannelTest | 1946 // VoiceChannelTest |
1956 | 1947 |
1957 TEST_F(VoiceChannelTest, TestInit) { | 1948 TEST_F(VoiceChannelTest, TestInit) { |
1958 Base::TestInit(); | 1949 Base::TestInit(); |
1959 EXPECT_FALSE(media_channel1_->IsStreamMuted(0)); | 1950 EXPECT_FALSE(media_channel1_->IsStreamMuted(0)); |
1960 EXPECT_TRUE(media_channel1_->dtmf_info_queue().empty()); | 1951 EXPECT_TRUE(media_channel1_->dtmf_info_queue().empty()); |
(...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2836 }; | 2827 }; |
2837 rtc::Buffer payload(data, 3); | 2828 rtc::Buffer payload(data, 3); |
2838 cricket::SendDataResult result; | 2829 cricket::SendDataResult result; |
2839 ASSERT_TRUE(media_channel1_->SendData(params, payload, &result)); | 2830 ASSERT_TRUE(media_channel1_->SendData(params, payload, &result)); |
2840 EXPECT_EQ(params.ssrc, | 2831 EXPECT_EQ(params.ssrc, |
2841 media_channel1_->last_sent_data_params().ssrc); | 2832 media_channel1_->last_sent_data_params().ssrc); |
2842 EXPECT_EQ("foo", media_channel1_->last_sent_data()); | 2833 EXPECT_EQ("foo", media_channel1_->last_sent_data()); |
2843 } | 2834 } |
2844 | 2835 |
2845 // TODO(pthatcher): TestSetReceiver? | 2836 // TODO(pthatcher): TestSetReceiver? |
OLD | NEW |