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

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
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 1752 matching lines...) Expand 10 before | Expand all | Expand 10 after
1763 1763
1764 template<> 1764 template<>
1765 void ChannelTest<VoiceTraits>::CreateContent( 1765 void ChannelTest<VoiceTraits>::CreateContent(
1766 int flags, 1766 int flags,
1767 const cricket::AudioCodec& audio_codec, 1767 const cricket::AudioCodec& audio_codec,
1768 const cricket::VideoCodec& video_codec, 1768 const cricket::VideoCodec& video_codec,
1769 cricket::AudioContentDescription* audio) { 1769 cricket::AudioContentDescription* audio) {
1770 audio->AddCodec(audio_codec); 1770 audio->AddCodec(audio_codec);
1771 audio->set_rtcp_mux((flags & RTCP_MUX) != 0); 1771 audio->set_rtcp_mux((flags & RTCP_MUX) != 0);
1772 if (flags & SECURE) { 1772 if (flags & SECURE) {
1773 audio->AddCrypto(cricket::CryptoParams( 1773 audio->AddCrypto(
1774 1, cricket::CS_AES_CM_128_HMAC_SHA1_32, 1774 cricket::CryptoParams(1, rtc::CS_AES_CM_128_HMAC_SHA1_32,
1775 "inline:" + rtc::CreateRandomString(40), "")); 1775 "inline:" + rtc::CreateRandomString(40), ""));
Ryan Sleevi 2015/09/28 17:24:17 nit: std::string() will be slightly more efficient
guoweis_webrtc 2015/09/30 04:09:46 Done.
1776 } 1776 }
1777 } 1777 }
1778 1778
1779 template<> 1779 template<>
1780 void ChannelTest<VoiceTraits>::CopyContent( 1780 void ChannelTest<VoiceTraits>::CopyContent(
1781 const cricket::AudioContentDescription& source, 1781 const cricket::AudioContentDescription& source,
1782 cricket::AudioContentDescription* audio) { 1782 cricket::AudioContentDescription* audio) {
1783 *audio = source; 1783 *audio = source;
1784 } 1784 }
1785 1785
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
1830 1830
1831 template<> 1831 template<>
1832 void ChannelTest<VideoTraits>::CreateContent( 1832 void ChannelTest<VideoTraits>::CreateContent(
1833 int flags, 1833 int flags,
1834 const cricket::AudioCodec& audio_codec, 1834 const cricket::AudioCodec& audio_codec,
1835 const cricket::VideoCodec& video_codec, 1835 const cricket::VideoCodec& video_codec,
1836 cricket::VideoContentDescription* video) { 1836 cricket::VideoContentDescription* video) {
1837 video->AddCodec(video_codec); 1837 video->AddCodec(video_codec);
1838 video->set_rtcp_mux((flags & RTCP_MUX) != 0); 1838 video->set_rtcp_mux((flags & RTCP_MUX) != 0);
1839 if (flags & SECURE) { 1839 if (flags & SECURE) {
1840 video->AddCrypto(cricket::CryptoParams( 1840 video->AddCrypto(
1841 1, cricket::CS_AES_CM_128_HMAC_SHA1_80, 1841 cricket::CryptoParams(1, rtc::CS_AES_CM_128_HMAC_SHA1_80,
1842 "inline:" + rtc::CreateRandomString(40), "")); 1842 "inline:" + rtc::CreateRandomString(40), ""));
Ryan Sleevi 2015/09/28 17:24:17 same throughout
guoweis_webrtc 2015/09/30 04:09:46 Done.
1843 } 1843 }
1844 } 1844 }
1845 1845
1846 template<> 1846 template<>
1847 void ChannelTest<VideoTraits>::CopyContent( 1847 void ChannelTest<VideoTraits>::CopyContent(
1848 const cricket::VideoContentDescription& source, 1848 const cricket::VideoContentDescription& source,
1849 cricket::VideoContentDescription* video) { 1849 cricket::VideoContentDescription* video) {
1850 *video = source; 1850 *video = source;
1851 } 1851 }
1852 1852
(...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after
2580 2580
2581 template<> 2581 template<>
2582 void ChannelTest<DataTraits>::CreateContent( 2582 void ChannelTest<DataTraits>::CreateContent(
2583 int flags, 2583 int flags,
2584 const cricket::AudioCodec& audio_codec, 2584 const cricket::AudioCodec& audio_codec,
2585 const cricket::VideoCodec& video_codec, 2585 const cricket::VideoCodec& video_codec,
2586 cricket::DataContentDescription* data) { 2586 cricket::DataContentDescription* data) {
2587 data->AddCodec(kGoogleDataCodec); 2587 data->AddCodec(kGoogleDataCodec);
2588 data->set_rtcp_mux((flags & RTCP_MUX) != 0); 2588 data->set_rtcp_mux((flags & RTCP_MUX) != 0);
2589 if (flags & SECURE) { 2589 if (flags & SECURE) {
2590 data->AddCrypto(cricket::CryptoParams( 2590 data->AddCrypto(
2591 1, cricket::CS_AES_CM_128_HMAC_SHA1_32, 2591 cricket::CryptoParams(1, rtc::CS_AES_CM_128_HMAC_SHA1_32,
2592 "inline:" + rtc::CreateRandomString(40), "")); 2592 "inline:" + rtc::CreateRandomString(40), ""));
2593 } 2593 }
2594 } 2594 }
2595 2595
2596 template<> 2596 template<>
2597 void ChannelTest<DataTraits>::CopyContent( 2597 void ChannelTest<DataTraits>::CopyContent(
2598 const cricket::DataContentDescription& source, 2598 const cricket::DataContentDescription& source,
2599 cricket::DataContentDescription* data) { 2599 cricket::DataContentDescription* data) {
2600 *data = source; 2600 *data = source;
2601 } 2601 }
2602 2602
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
2749 }; 2749 };
2750 rtc::Buffer payload(data, 3); 2750 rtc::Buffer payload(data, 3);
2751 cricket::SendDataResult result; 2751 cricket::SendDataResult result;
2752 ASSERT_TRUE(media_channel1_->SendData(params, payload, &result)); 2752 ASSERT_TRUE(media_channel1_->SendData(params, payload, &result));
2753 EXPECT_EQ(params.ssrc, 2753 EXPECT_EQ(params.ssrc,
2754 media_channel1_->last_sent_data_params().ssrc); 2754 media_channel1_->last_sent_data_params().ssrc);
2755 EXPECT_EQ("foo", media_channel1_->last_sent_data()); 2755 EXPECT_EQ("foo", media_channel1_->last_sent_data());
2756 } 2756 }
2757 2757
2758 // TODO(pthatcher): TestSetReceiver? 2758 // TODO(pthatcher): TestSetReceiver?
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698