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

Side by Side Diff: talk/media/webrtc/webrtcvoiceengine_unittest.cc

Issue 1486123002: Return a copy of the supported RTP header extensions instead of a reference. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Merge Created 5 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 | « talk/media/webrtc/webrtcvoiceengine.cc ('k') | talk/session/media/channelmanager.cc » ('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 2008 Google Inc. 3 * Copyright 2008 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 3091 matching lines...) Expand 10 before | Expand all | Expand 10 after
3102 3102
3103 // Combined BWE should be set up, but with no configured extensions. 3103 // Combined BWE should be set up, but with no configured extensions.
3104 EXPECT_EQ(2, call_.GetAudioReceiveStreams().size()); 3104 EXPECT_EQ(2, call_.GetAudioReceiveStreams().size());
3105 for (uint32_t ssrc : ssrcs) { 3105 for (uint32_t ssrc : ssrcs) {
3106 const auto* s = call_.GetAudioReceiveStream(ssrc); 3106 const auto* s = call_.GetAudioReceiveStream(ssrc);
3107 EXPECT_NE(nullptr, s); 3107 EXPECT_NE(nullptr, s);
3108 EXPECT_EQ(0, s->GetConfig().rtp.extensions.size()); 3108 EXPECT_EQ(0, s->GetConfig().rtp.extensions.size());
3109 } 3109 }
3110 3110
3111 // Set up receive extensions. 3111 // Set up receive extensions.
3112 const auto& e_exts = engine_.rtp_header_extensions(); 3112 cricket::RtpCapabilities capabilities = engine_.GetCapabilities();
3113 cricket::AudioRecvParameters recv_parameters; 3113 cricket::AudioRecvParameters recv_parameters;
3114 recv_parameters.extensions = e_exts; 3114 recv_parameters.extensions = capabilities.header_extensions;
3115 channel_->SetRecvParameters(recv_parameters); 3115 channel_->SetRecvParameters(recv_parameters);
3116 EXPECT_EQ(2, call_.GetAudioReceiveStreams().size()); 3116 EXPECT_EQ(2, call_.GetAudioReceiveStreams().size());
3117 for (uint32_t ssrc : ssrcs) { 3117 for (uint32_t ssrc : ssrcs) {
3118 const auto* s = call_.GetAudioReceiveStream(ssrc); 3118 const auto* s = call_.GetAudioReceiveStream(ssrc);
3119 EXPECT_NE(nullptr, s); 3119 EXPECT_NE(nullptr, s);
3120 const auto& s_exts = s->GetConfig().rtp.extensions; 3120 const auto& s_exts = s->GetConfig().rtp.extensions;
3121 EXPECT_EQ(e_exts.size(), s_exts.size()); 3121 EXPECT_EQ(capabilities.header_extensions.size(), s_exts.size());
3122 for (const auto& e_ext : e_exts) { 3122 for (const auto& e_ext : capabilities.header_extensions) {
3123 for (const auto& s_ext : s_exts) { 3123 for (const auto& s_ext : s_exts) {
3124 if (e_ext.id == s_ext.id) { 3124 if (e_ext.id == s_ext.id) {
3125 EXPECT_EQ(e_ext.uri, s_ext.name); 3125 EXPECT_EQ(e_ext.uri, s_ext.name);
3126 } 3126 }
3127 } 3127 }
3128 } 3128 }
3129 } 3129 }
3130 3130
3131 // Disable receive extensions. 3131 // Disable receive extensions.
3132 channel_->SetRecvParameters(cricket::AudioRecvParameters()); 3132 channel_->SetRecvParameters(cricket::AudioRecvParameters());
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
3352 cricket::WebRtcVoiceEngine engine; 3352 cricket::WebRtcVoiceEngine engine;
3353 EXPECT_TRUE(engine.Init(rtc::Thread::Current())); 3353 EXPECT_TRUE(engine.Init(rtc::Thread::Current()));
3354 rtc::scoped_ptr<webrtc::Call> call( 3354 rtc::scoped_ptr<webrtc::Call> call(
3355 webrtc::Call::Create(webrtc::Call::Config())); 3355 webrtc::Call::Create(webrtc::Call::Config()));
3356 cricket::WebRtcVoiceMediaChannel channel(&engine, cricket::AudioOptions(), 3356 cricket::WebRtcVoiceMediaChannel channel(&engine, cricket::AudioOptions(),
3357 call.get()); 3357 call.get());
3358 cricket::AudioRecvParameters parameters; 3358 cricket::AudioRecvParameters parameters;
3359 parameters.codecs = engine.codecs(); 3359 parameters.codecs = engine.codecs();
3360 EXPECT_TRUE(channel.SetRecvParameters(parameters)); 3360 EXPECT_TRUE(channel.SetRecvParameters(parameters));
3361 } 3361 }
OLDNEW
« no previous file with comments | « talk/media/webrtc/webrtcvoiceengine.cc ('k') | talk/session/media/channelmanager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698