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

Side by Side Diff: webrtc/api/webrtcsession_unittest.cc

Issue 1838413002: Combining SetVideoSend and SetSource into one method. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Addressing pbos@'s comments. Created 4 years, 7 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 * Copyright 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2012 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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 cricket::TransportChannel* data_rtp_transport_channel() { 241 cricket::TransportChannel* data_rtp_transport_channel() {
242 return rtp_transport_channel(data_channel()); 242 return rtp_transport_channel(data_channel());
243 } 243 }
244 244
245 cricket::TransportChannel* data_rtcp_transport_channel() { 245 cricket::TransportChannel* data_rtcp_transport_channel() {
246 return rtcp_transport_channel(data_channel()); 246 return rtcp_transport_channel(data_channel());
247 } 247 }
248 248
249 using webrtc::WebRtcSession::SetAudioPlayout; 249 using webrtc::WebRtcSession::SetAudioPlayout;
250 using webrtc::WebRtcSession::SetAudioSend; 250 using webrtc::WebRtcSession::SetAudioSend;
251 using webrtc::WebRtcSession::SetSource;
252 using webrtc::WebRtcSession::SetVideoPlayout; 251 using webrtc::WebRtcSession::SetVideoPlayout;
253 using webrtc::WebRtcSession::SetVideoSend; 252 using webrtc::WebRtcSession::SetVideoSend;
254 253
255 private: 254 private:
256 cricket::TransportChannel* rtp_transport_channel(cricket::BaseChannel* ch) { 255 cricket::TransportChannel* rtp_transport_channel(cricket::BaseChannel* ch) {
257 if (!ch) { 256 if (!ch) {
258 return nullptr; 257 return nullptr;
259 } 258 }
260 return ch->transport_channel(); 259 return ch->transport_channel();
261 } 260 }
(...skipping 3213 matching lines...) Expand 10 before | Expand all | Expand 10 after
3475 TEST_F(WebRtcSessionTest, SetVideoSend) { 3474 TEST_F(WebRtcSessionTest, SetVideoSend) {
3476 Init(); 3475 Init();
3477 SendAudioVideoStream1(); 3476 SendAudioVideoStream1();
3478 CreateAndSetRemoteOfferAndLocalAnswer(); 3477 CreateAndSetRemoteOfferAndLocalAnswer();
3479 cricket::FakeVideoMediaChannel* channel = media_engine_->GetVideoChannel(0); 3478 cricket::FakeVideoMediaChannel* channel = media_engine_->GetVideoChannel(0);
3480 ASSERT_TRUE(channel != NULL); 3479 ASSERT_TRUE(channel != NULL);
3481 ASSERT_EQ(1u, channel->send_streams().size()); 3480 ASSERT_EQ(1u, channel->send_streams().size());
3482 uint32_t send_ssrc = channel->send_streams()[0].first_ssrc(); 3481 uint32_t send_ssrc = channel->send_streams()[0].first_ssrc();
3483 EXPECT_FALSE(channel->IsStreamMuted(send_ssrc)); 3482 EXPECT_FALSE(channel->IsStreamMuted(send_ssrc));
3484 cricket::VideoOptions* options = NULL; 3483 cricket::VideoOptions* options = NULL;
3485 session_->SetVideoSend(send_ssrc, false, options); 3484 session_->SetVideoSend(send_ssrc, false, options, nullptr);
3486 EXPECT_TRUE(channel->IsStreamMuted(send_ssrc)); 3485 EXPECT_TRUE(channel->IsStreamMuted(send_ssrc));
3487 session_->SetVideoSend(send_ssrc, true, options); 3486 session_->SetVideoSend(send_ssrc, true, options, nullptr);
3488 EXPECT_FALSE(channel->IsStreamMuted(send_ssrc)); 3487 EXPECT_FALSE(channel->IsStreamMuted(send_ssrc));
3489 } 3488 }
3490 3489
3491 TEST_F(WebRtcSessionTest, CanNotInsertDtmf) { 3490 TEST_F(WebRtcSessionTest, CanNotInsertDtmf) {
3492 TestCanInsertDtmf(false); 3491 TestCanInsertDtmf(false);
3493 } 3492 }
3494 3493
3495 TEST_F(WebRtcSessionTest, CanInsertDtmf) { 3494 TEST_F(WebRtcSessionTest, CanInsertDtmf) {
3496 TestCanInsertDtmf(true); 3495 TestCanInsertDtmf(true);
3497 } 3496 }
(...skipping 860 matching lines...) Expand 10 before | Expand all | Expand 10 after
4358 } 4357 }
4359 4358
4360 // TODO(bemasc): Add a TestIceStatesBundle with BUNDLE enabled. That test 4359 // TODO(bemasc): Add a TestIceStatesBundle with BUNDLE enabled. That test
4361 // currently fails because upon disconnection and reconnection OnIceComplete is 4360 // currently fails because upon disconnection and reconnection OnIceComplete is
4362 // called more than once without returning to IceGatheringGathering. 4361 // called more than once without returning to IceGatheringGathering.
4363 4362
4364 INSTANTIATE_TEST_CASE_P(WebRtcSessionTests, 4363 INSTANTIATE_TEST_CASE_P(WebRtcSessionTests,
4365 WebRtcSessionTest, 4364 WebRtcSessionTest,
4366 testing::Values(ALREADY_GENERATED, 4365 testing::Values(ALREADY_GENERATED,
4367 DTLS_IDENTITY_STORE)); 4366 DTLS_IDENTITY_STORE));
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698