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

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

Issue 1337673002: Change WebRTC SslCipher to be exposed as number only. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: 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') | talk/session/media/mediasession.h » ('j') | 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 1799 matching lines...) Expand 10 before | Expand all | Expand 10 after
1810 template<> 1810 template<>
1811 void ChannelTest<VoiceTraits>::CreateContent( 1811 void ChannelTest<VoiceTraits>::CreateContent(
1812 int flags, 1812 int flags,
1813 const cricket::AudioCodec& audio_codec, 1813 const cricket::AudioCodec& audio_codec,
1814 const cricket::VideoCodec& video_codec, 1814 const cricket::VideoCodec& video_codec,
1815 cricket::AudioContentDescription* audio) { 1815 cricket::AudioContentDescription* audio) {
1816 audio->AddCodec(audio_codec); 1816 audio->AddCodec(audio_codec);
1817 audio->set_rtcp_mux((flags & RTCP_MUX) != 0); 1817 audio->set_rtcp_mux((flags & RTCP_MUX) != 0);
1818 if (flags & SECURE) { 1818 if (flags & SECURE) {
1819 audio->AddCrypto(cricket::CryptoParams( 1819 audio->AddCrypto(cricket::CryptoParams(
1820 1, cricket::CS_AES_CM_128_HMAC_SHA1_32, 1820 1, rtc::CS_AES_CM_128_HMAC_SHA1_32,
1821 "inline:" + rtc::CreateRandomString(40), "")); 1821 "inline:" + rtc::CreateRandomString(40), std::string()));
1822 } 1822 }
1823 } 1823 }
1824 1824
1825 template<> 1825 template<>
1826 void ChannelTest<VoiceTraits>::CopyContent( 1826 void ChannelTest<VoiceTraits>::CopyContent(
1827 const cricket::AudioContentDescription& source, 1827 const cricket::AudioContentDescription& source,
1828 cricket::AudioContentDescription* audio) { 1828 cricket::AudioContentDescription* audio) {
1829 *audio = source; 1829 *audio = source;
1830 } 1830 }
1831 1831
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
1880 template<> 1880 template<>
1881 void ChannelTest<VideoTraits>::CreateContent( 1881 void ChannelTest<VideoTraits>::CreateContent(
1882 int flags, 1882 int flags,
1883 const cricket::AudioCodec& audio_codec, 1883 const cricket::AudioCodec& audio_codec,
1884 const cricket::VideoCodec& video_codec, 1884 const cricket::VideoCodec& video_codec,
1885 cricket::VideoContentDescription* video) { 1885 cricket::VideoContentDescription* video) {
1886 video->AddCodec(video_codec); 1886 video->AddCodec(video_codec);
1887 video->set_rtcp_mux((flags & RTCP_MUX) != 0); 1887 video->set_rtcp_mux((flags & RTCP_MUX) != 0);
1888 if (flags & SECURE) { 1888 if (flags & SECURE) {
1889 video->AddCrypto(cricket::CryptoParams( 1889 video->AddCrypto(cricket::CryptoParams(
1890 1, cricket::CS_AES_CM_128_HMAC_SHA1_80, 1890 1, rtc::CS_AES_CM_128_HMAC_SHA1_80,
1891 "inline:" + rtc::CreateRandomString(40), "")); 1891 "inline:" + rtc::CreateRandomString(40), std::string()));
1892 } 1892 }
1893 } 1893 }
1894 1894
1895 template<> 1895 template<>
1896 void ChannelTest<VideoTraits>::CopyContent( 1896 void ChannelTest<VideoTraits>::CopyContent(
1897 const cricket::VideoContentDescription& source, 1897 const cricket::VideoContentDescription& source,
1898 cricket::VideoContentDescription* video) { 1898 cricket::VideoContentDescription* video) {
1899 *video = source; 1899 *video = source;
1900 } 1900 }
1901 1901
(...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after
2573 cricket::StreamSelector(kSsrc1), 160, 100, 8)); 2573 cricket::StreamSelector(kSsrc1), 160, 100, 8));
2574 EXPECT_TRUE(channel1_->ApplyViewRequest(request)); 2574 EXPECT_TRUE(channel1_->ApplyViewRequest(request));
2575 EXPECT_TRUE(media_channel1_->GetSendStreamFormat(kSsrc1, &send_format)); 2575 EXPECT_TRUE(media_channel1_->GetSendStreamFormat(kSsrc1, &send_format));
2576 EXPECT_EQ(160, send_format.width); 2576 EXPECT_EQ(160, send_format.width);
2577 EXPECT_EQ(100, send_format.height); 2577 EXPECT_EQ(100, send_format.height);
2578 EXPECT_EQ(cricket::VideoFormat::FpsToInterval(8), send_format.interval); 2578 EXPECT_EQ(cricket::VideoFormat::FpsToInterval(8), send_format.interval);
2579 2579
2580 // stream1: 0x0x0; stream2: 640x400x30 2580 // stream1: 0x0x0; stream2: 640x400x30
2581 request.static_video_views.clear(); 2581 request.static_video_views.clear();
2582 request.static_video_views.push_back(cricket::StaticVideoView( 2582 request.static_video_views.push_back(cricket::StaticVideoView(
2583 cricket::StreamSelector("", stream2.id), 640, 400, 30)); 2583 cricket::StreamSelector(std::string(), stream2.id), 640, 400, 30));
2584 EXPECT_TRUE(channel1_->ApplyViewRequest(request)); 2584 EXPECT_TRUE(channel1_->ApplyViewRequest(request));
2585 EXPECT_TRUE(media_channel1_->GetSendStreamFormat(kSsrc1, &send_format)); 2585 EXPECT_TRUE(media_channel1_->GetSendStreamFormat(kSsrc1, &send_format));
2586 EXPECT_EQ(0, send_format.width); 2586 EXPECT_EQ(0, send_format.width);
2587 EXPECT_EQ(0, send_format.height); 2587 EXPECT_EQ(0, send_format.height);
2588 EXPECT_TRUE(media_channel1_->GetSendStreamFormat(2222, &send_format)); 2588 EXPECT_TRUE(media_channel1_->GetSendStreamFormat(2222, &send_format));
2589 EXPECT_EQ(640, send_format.width); 2589 EXPECT_EQ(640, send_format.width);
2590 EXPECT_EQ(400, send_format.height); 2590 EXPECT_EQ(400, send_format.height);
2591 EXPECT_EQ(cricket::VideoFormat::FpsToInterval(30), send_format.interval); 2591 EXPECT_EQ(cricket::VideoFormat::FpsToInterval(30), send_format.interval);
2592 2592
2593 // stream1: 0x0x0; stream2: 0x0x0 2593 // stream1: 0x0x0; stream2: 0x0x0
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
2634 template<> 2634 template<>
2635 void ChannelTest<DataTraits>::CreateContent( 2635 void ChannelTest<DataTraits>::CreateContent(
2636 int flags, 2636 int flags,
2637 const cricket::AudioCodec& audio_codec, 2637 const cricket::AudioCodec& audio_codec,
2638 const cricket::VideoCodec& video_codec, 2638 const cricket::VideoCodec& video_codec,
2639 cricket::DataContentDescription* data) { 2639 cricket::DataContentDescription* data) {
2640 data->AddCodec(kGoogleDataCodec); 2640 data->AddCodec(kGoogleDataCodec);
2641 data->set_rtcp_mux((flags & RTCP_MUX) != 0); 2641 data->set_rtcp_mux((flags & RTCP_MUX) != 0);
2642 if (flags & SECURE) { 2642 if (flags & SECURE) {
2643 data->AddCrypto(cricket::CryptoParams( 2643 data->AddCrypto(cricket::CryptoParams(
2644 1, cricket::CS_AES_CM_128_HMAC_SHA1_32, 2644 1, rtc::CS_AES_CM_128_HMAC_SHA1_32,
2645 "inline:" + rtc::CreateRandomString(40), "")); 2645 "inline:" + rtc::CreateRandomString(40), std::string()));
2646 } 2646 }
2647 } 2647 }
2648 2648
2649 template<> 2649 template<>
2650 void ChannelTest<DataTraits>::CopyContent( 2650 void ChannelTest<DataTraits>::CopyContent(
2651 const cricket::DataContentDescription& source, 2651 const cricket::DataContentDescription& source,
2652 cricket::DataContentDescription* data) { 2652 cricket::DataContentDescription* data) {
2653 *data = source; 2653 *data = source;
2654 } 2654 }
2655 2655
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
2802 }; 2802 };
2803 rtc::Buffer payload(data, 3); 2803 rtc::Buffer payload(data, 3);
2804 cricket::SendDataResult result; 2804 cricket::SendDataResult result;
2805 ASSERT_TRUE(media_channel1_->SendData(params, payload, &result)); 2805 ASSERT_TRUE(media_channel1_->SendData(params, payload, &result));
2806 EXPECT_EQ(params.ssrc, 2806 EXPECT_EQ(params.ssrc,
2807 media_channel1_->last_sent_data_params().ssrc); 2807 media_channel1_->last_sent_data_params().ssrc);
2808 EXPECT_EQ("foo", media_channel1_->last_sent_data()); 2808 EXPECT_EQ("foo", media_channel1_->last_sent_data());
2809 } 2809 }
2810 2810
2811 // TODO(pthatcher): TestSetReceiver? 2811 // TODO(pthatcher): TestSetReceiver?
OLDNEW
« no previous file with comments | « talk/session/media/channel.cc ('k') | talk/session/media/mediasession.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698