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

Side by Side Diff: webrtc/pc/channel_unittest.cc

Issue 2537343003: Removing "crypto_required" from MediaContentDescription. (Closed)
Patch Set: Merge with master and clean up CreateDataChannel Created 4 years 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 | « webrtc/pc/channel.cc ('k') | webrtc/pc/channelmanager.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 * 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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 AddLegacyStreamInContent(kSsrc2, flags2, &remote_media_content2_); 183 AddLegacyStreamInContent(kSsrc2, flags2, &remote_media_content2_);
184 } 184 }
185 } 185 }
186 typename T::Channel* CreateChannel( 186 typename T::Channel* CreateChannel(
187 rtc::Thread* worker_thread, 187 rtc::Thread* worker_thread,
188 rtc::Thread* network_thread, 188 rtc::Thread* network_thread,
189 cricket::MediaEngineInterface* engine, 189 cricket::MediaEngineInterface* engine,
190 typename T::MediaChannel* ch, 190 typename T::MediaChannel* ch,
191 cricket::TransportController* transport_controller, 191 cricket::TransportController* transport_controller,
192 int flags) { 192 int flags) {
193 typename T::Channel* channel = 193 typename T::Channel* channel = new typename T::Channel(
194 new typename T::Channel(worker_thread, network_thread, engine, ch, 194 worker_thread, network_thread, engine, ch, transport_controller,
195 transport_controller, cricket::CN_AUDIO, 195 cricket::CN_AUDIO, (flags & RTCP) != 0, (flags & SECURE) != 0);
196 (flags & RTCP) != 0);
197 rtc::CryptoOptions crypto_options; 196 rtc::CryptoOptions crypto_options;
198 crypto_options.enable_gcm_crypto_suites = (flags & GCM_CIPHER) != 0; 197 crypto_options.enable_gcm_crypto_suites = (flags & GCM_CIPHER) != 0;
199 channel->SetCryptoOptions(crypto_options); 198 channel->SetCryptoOptions(crypto_options);
200 if (!channel->Init_w(nullptr)) { 199 if (!channel->Init_w(nullptr)) {
201 delete channel; 200 delete channel;
202 channel = NULL; 201 channel = NULL;
203 } 202 }
204 return channel; 203 return channel;
205 } 204 }
206 205
(...skipping 1828 matching lines...) Expand 10 before | Expand all | Expand 10 after
2035 2034
2036 // override to add NULL parameter 2035 // override to add NULL parameter
2037 template <> 2036 template <>
2038 cricket::VideoChannel* ChannelTest<VideoTraits>::CreateChannel( 2037 cricket::VideoChannel* ChannelTest<VideoTraits>::CreateChannel(
2039 rtc::Thread* worker_thread, 2038 rtc::Thread* worker_thread,
2040 rtc::Thread* network_thread, 2039 rtc::Thread* network_thread,
2041 cricket::MediaEngineInterface* engine, 2040 cricket::MediaEngineInterface* engine,
2042 cricket::FakeVideoMediaChannel* ch, 2041 cricket::FakeVideoMediaChannel* ch,
2043 cricket::TransportController* transport_controller, 2042 cricket::TransportController* transport_controller,
2044 int flags) { 2043 int flags) {
2045 cricket::VideoChannel* channel = 2044 cricket::VideoChannel* channel = new cricket::VideoChannel(
2046 new cricket::VideoChannel(worker_thread, network_thread, ch, 2045 worker_thread, network_thread, ch, transport_controller,
2047 transport_controller, cricket::CN_VIDEO, 2046 cricket::CN_VIDEO, (flags & RTCP) != 0, (flags & SECURE) != 0);
2048 (flags & RTCP) != 0);
2049 rtc::CryptoOptions crypto_options; 2047 rtc::CryptoOptions crypto_options;
2050 crypto_options.enable_gcm_crypto_suites = (flags & GCM_CIPHER) != 0; 2048 crypto_options.enable_gcm_crypto_suites = (flags & GCM_CIPHER) != 0;
2051 channel->SetCryptoOptions(crypto_options); 2049 channel->SetCryptoOptions(crypto_options);
2052 if (!channel->Init_w(nullptr)) { 2050 if (!channel->Init_w(nullptr)) {
2053 delete channel; 2051 delete channel;
2054 channel = NULL; 2052 channel = NULL;
2055 } 2053 }
2056 return channel; 2054 return channel;
2057 } 2055 }
2058 2056
(...skipping 1249 matching lines...) Expand 10 before | Expand all | Expand 10 after
3308 3306
3309 // Override to avoid engine channel parameter. 3307 // Override to avoid engine channel parameter.
3310 template <> 3308 template <>
3311 cricket::DataChannel* ChannelTest<DataTraits>::CreateChannel( 3309 cricket::DataChannel* ChannelTest<DataTraits>::CreateChannel(
3312 rtc::Thread* worker_thread, 3310 rtc::Thread* worker_thread,
3313 rtc::Thread* network_thread, 3311 rtc::Thread* network_thread,
3314 cricket::MediaEngineInterface* engine, 3312 cricket::MediaEngineInterface* engine,
3315 cricket::FakeDataMediaChannel* ch, 3313 cricket::FakeDataMediaChannel* ch,
3316 cricket::TransportController* transport_controller, 3314 cricket::TransportController* transport_controller,
3317 int flags) { 3315 int flags) {
3318 cricket::DataChannel* channel = 3316 cricket::DataChannel* channel = new cricket::DataChannel(
3319 new cricket::DataChannel(worker_thread, network_thread, ch, 3317 worker_thread, network_thread, ch, transport_controller, cricket::CN_DATA,
3320 transport_controller, cricket::CN_DATA, 3318 (flags & RTCP) != 0, (flags & SECURE) != 0);
3321 (flags & RTCP) != 0);
3322 rtc::CryptoOptions crypto_options; 3319 rtc::CryptoOptions crypto_options;
3323 crypto_options.enable_gcm_crypto_suites = (flags & GCM_CIPHER) != 0; 3320 crypto_options.enable_gcm_crypto_suites = (flags & GCM_CIPHER) != 0;
3324 channel->SetCryptoOptions(crypto_options); 3321 channel->SetCryptoOptions(crypto_options);
3325 if (!channel->Init_w(nullptr)) { 3322 if (!channel->Init_w(nullptr)) {
3326 delete channel; 3323 delete channel;
3327 channel = NULL; 3324 channel = NULL;
3328 } 3325 }
3329 return channel; 3326 return channel;
3330 } 3327 }
3331 3328
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
3650 }; 3647 };
3651 rtc::CopyOnWriteBuffer payload(data, 3); 3648 rtc::CopyOnWriteBuffer payload(data, 3);
3652 cricket::SendDataResult result; 3649 cricket::SendDataResult result;
3653 ASSERT_TRUE(media_channel1_->SendData(params, payload, &result)); 3650 ASSERT_TRUE(media_channel1_->SendData(params, payload, &result));
3654 EXPECT_EQ(params.ssrc, 3651 EXPECT_EQ(params.ssrc,
3655 media_channel1_->last_sent_data_params().ssrc); 3652 media_channel1_->last_sent_data_params().ssrc);
3656 EXPECT_EQ("foo", media_channel1_->last_sent_data()); 3653 EXPECT_EQ("foo", media_channel1_->last_sent_data());
3657 } 3654 }
3658 3655
3659 // TODO(pthatcher): TestSetReceiver? 3656 // TODO(pthatcher): TestSetReceiver?
OLDNEW
« no previous file with comments | « webrtc/pc/channel.cc ('k') | webrtc/pc/channelmanager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698