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

Side by Side Diff: webrtc/call/rtc_event_log_unittest_helper.cc

Issue 1984983002: Remove use of RtpHeaderExtension and clean up (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Addressed nit Created 4 years, 6 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 (c) 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2016 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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 } 146 }
147 // Check header extensions. 147 // Check header extensions.
148 ASSERT_EQ(static_cast<int>(config.rtp.extensions.size()), 148 ASSERT_EQ(static_cast<int>(config.rtp.extensions.size()),
149 receiver_config.header_extensions_size()); 149 receiver_config.header_extensions_size());
150 for (int i = 0; i < receiver_config.header_extensions_size(); i++) { 150 for (int i = 0; i < receiver_config.header_extensions_size(); i++) {
151 ASSERT_TRUE(receiver_config.header_extensions(i).has_name()); 151 ASSERT_TRUE(receiver_config.header_extensions(i).has_name());
152 ASSERT_TRUE(receiver_config.header_extensions(i).has_id()); 152 ASSERT_TRUE(receiver_config.header_extensions(i).has_id());
153 const std::string& name = receiver_config.header_extensions(i).name(); 153 const std::string& name = receiver_config.header_extensions(i).name();
154 int id = receiver_config.header_extensions(i).id(); 154 int id = receiver_config.header_extensions(i).id();
155 EXPECT_EQ(config.rtp.extensions[i].id, id); 155 EXPECT_EQ(config.rtp.extensions[i].id, id);
156 EXPECT_EQ(config.rtp.extensions[i].name, name); 156 EXPECT_EQ(config.rtp.extensions[i].uri, name);
157 } 157 }
158 // Check decoders. 158 // Check decoders.
159 ASSERT_EQ(static_cast<int>(config.decoders.size()), 159 ASSERT_EQ(static_cast<int>(config.decoders.size()),
160 receiver_config.decoders_size()); 160 receiver_config.decoders_size());
161 for (int i = 0; i < receiver_config.decoders_size(); i++) { 161 for (int i = 0; i < receiver_config.decoders_size(); i++) {
162 ASSERT_TRUE(receiver_config.decoders(i).has_name()); 162 ASSERT_TRUE(receiver_config.decoders(i).has_name());
163 ASSERT_TRUE(receiver_config.decoders(i).has_payload_type()); 163 ASSERT_TRUE(receiver_config.decoders(i).has_payload_type());
164 const std::string& decoder_name = receiver_config.decoders(i).name(); 164 const std::string& decoder_name = receiver_config.decoders(i).name();
165 int decoder_type = receiver_config.decoders(i).payload_type(); 165 int decoder_type = receiver_config.decoders(i).payload_type();
166 EXPECT_EQ(config.decoders[i].payload_name, decoder_name); 166 EXPECT_EQ(config.decoders[i].payload_name, decoder_name);
(...skipping 12 matching lines...) Expand all
179 EXPECT_EQ(config.rtp.rtx.size(), parsed_config.rtp.rtx.size()); 179 EXPECT_EQ(config.rtp.rtx.size(), parsed_config.rtp.rtx.size());
180 for (const auto& kv : config.rtp.rtx) { 180 for (const auto& kv : config.rtp.rtx) {
181 auto parsed_kv = parsed_config.rtp.rtx.find(kv.first); 181 auto parsed_kv = parsed_config.rtp.rtx.find(kv.first);
182 EXPECT_EQ(kv.first, parsed_kv->first); 182 EXPECT_EQ(kv.first, parsed_kv->first);
183 EXPECT_EQ(kv.second.ssrc, parsed_kv->second.ssrc); 183 EXPECT_EQ(kv.second.ssrc, parsed_kv->second.ssrc);
184 EXPECT_EQ(kv.second.payload_type, parsed_kv->second.payload_type); 184 EXPECT_EQ(kv.second.payload_type, parsed_kv->second.payload_type);
185 } 185 }
186 // Check header extensions. 186 // Check header extensions.
187 EXPECT_EQ(config.rtp.extensions.size(), parsed_config.rtp.extensions.size()); 187 EXPECT_EQ(config.rtp.extensions.size(), parsed_config.rtp.extensions.size());
188 for (size_t i = 0; i < parsed_config.rtp.extensions.size(); i++) { 188 for (size_t i = 0; i < parsed_config.rtp.extensions.size(); i++) {
189 EXPECT_EQ(config.rtp.extensions[i].name, 189 EXPECT_EQ(config.rtp.extensions[i].uri,
190 parsed_config.rtp.extensions[i].name); 190 parsed_config.rtp.extensions[i].uri);
191 EXPECT_EQ(config.rtp.extensions[i].id, parsed_config.rtp.extensions[i].id); 191 EXPECT_EQ(config.rtp.extensions[i].id, parsed_config.rtp.extensions[i].id);
192 } 192 }
193 // Check decoders. 193 // Check decoders.
194 EXPECT_EQ(config.decoders.size(), parsed_config.decoders.size()); 194 EXPECT_EQ(config.decoders.size(), parsed_config.decoders.size());
195 for (size_t i = 0; i < parsed_config.decoders.size(); i++) { 195 for (size_t i = 0; i < parsed_config.decoders.size(); i++) {
196 EXPECT_EQ(config.decoders[i].payload_name, 196 EXPECT_EQ(config.decoders[i].payload_name,
197 parsed_config.decoders[i].payload_name); 197 parsed_config.decoders[i].payload_name);
198 EXPECT_EQ(config.decoders[i].payload_type, 198 EXPECT_EQ(config.decoders[i].payload_type,
199 parsed_config.decoders[i].payload_type); 199 parsed_config.decoders[i].payload_type);
200 } 200 }
(...skipping 15 matching lines...) Expand all
216 } 216 }
217 // Check header extensions. 217 // Check header extensions.
218 ASSERT_EQ(static_cast<int>(config.rtp.extensions.size()), 218 ASSERT_EQ(static_cast<int>(config.rtp.extensions.size()),
219 sender_config.header_extensions_size()); 219 sender_config.header_extensions_size());
220 for (int i = 0; i < sender_config.header_extensions_size(); i++) { 220 for (int i = 0; i < sender_config.header_extensions_size(); i++) {
221 ASSERT_TRUE(sender_config.header_extensions(i).has_name()); 221 ASSERT_TRUE(sender_config.header_extensions(i).has_name());
222 ASSERT_TRUE(sender_config.header_extensions(i).has_id()); 222 ASSERT_TRUE(sender_config.header_extensions(i).has_id());
223 const std::string& name = sender_config.header_extensions(i).name(); 223 const std::string& name = sender_config.header_extensions(i).name();
224 int id = sender_config.header_extensions(i).id(); 224 int id = sender_config.header_extensions(i).id();
225 EXPECT_EQ(config.rtp.extensions[i].id, id); 225 EXPECT_EQ(config.rtp.extensions[i].id, id);
226 EXPECT_EQ(config.rtp.extensions[i].name, name); 226 EXPECT_EQ(config.rtp.extensions[i].uri, name);
227 } 227 }
228 // Check RTX settings. 228 // Check RTX settings.
229 ASSERT_EQ(static_cast<int>(config.rtp.rtx.ssrcs.size()), 229 ASSERT_EQ(static_cast<int>(config.rtp.rtx.ssrcs.size()),
230 sender_config.rtx_ssrcs_size()); 230 sender_config.rtx_ssrcs_size());
231 for (int i = 0; i < sender_config.rtx_ssrcs_size(); i++) { 231 for (int i = 0; i < sender_config.rtx_ssrcs_size(); i++) {
232 EXPECT_EQ(config.rtp.rtx.ssrcs[i], sender_config.rtx_ssrcs(i)); 232 EXPECT_EQ(config.rtp.rtx.ssrcs[i], sender_config.rtx_ssrcs(i));
233 } 233 }
234 if (sender_config.rtx_ssrcs_size() > 0) { 234 if (sender_config.rtx_ssrcs_size() > 0) {
235 ASSERT_TRUE(sender_config.has_rtx_payload_type()); 235 ASSERT_TRUE(sender_config.has_rtx_payload_type());
236 EXPECT_EQ(config.rtp.rtx.payload_type, sender_config.rtx_payload_type()); 236 EXPECT_EQ(config.rtp.rtx.payload_type, sender_config.rtx_payload_type());
(...skipping 11 matching lines...) Expand all
248 VideoSendStream::Config parsed_config(nullptr); 248 VideoSendStream::Config parsed_config(nullptr);
249 parsed_log.GetVideoSendConfig(index, &parsed_config); 249 parsed_log.GetVideoSendConfig(index, &parsed_config);
250 // Check SSRCs 250 // Check SSRCs
251 EXPECT_EQ(config.rtp.ssrcs.size(), parsed_config.rtp.ssrcs.size()); 251 EXPECT_EQ(config.rtp.ssrcs.size(), parsed_config.rtp.ssrcs.size());
252 for (size_t i = 0; i < config.rtp.ssrcs.size(); i++) { 252 for (size_t i = 0; i < config.rtp.ssrcs.size(); i++) {
253 EXPECT_EQ(config.rtp.ssrcs[i], parsed_config.rtp.ssrcs[i]); 253 EXPECT_EQ(config.rtp.ssrcs[i], parsed_config.rtp.ssrcs[i]);
254 } 254 }
255 // Check header extensions. 255 // Check header extensions.
256 EXPECT_EQ(config.rtp.extensions.size(), parsed_config.rtp.extensions.size()); 256 EXPECT_EQ(config.rtp.extensions.size(), parsed_config.rtp.extensions.size());
257 for (size_t i = 0; i < parsed_config.rtp.extensions.size(); i++) { 257 for (size_t i = 0; i < parsed_config.rtp.extensions.size(); i++) {
258 EXPECT_EQ(config.rtp.extensions[i].name, 258 EXPECT_EQ(config.rtp.extensions[i].uri,
259 parsed_config.rtp.extensions[i].name); 259 parsed_config.rtp.extensions[i].uri);
260 EXPECT_EQ(config.rtp.extensions[i].id, parsed_config.rtp.extensions[i].id); 260 EXPECT_EQ(config.rtp.extensions[i].id, parsed_config.rtp.extensions[i].id);
261 } 261 }
262 // Check RTX settings. 262 // Check RTX settings.
263 EXPECT_EQ(config.rtp.rtx.ssrcs.size(), parsed_config.rtp.rtx.ssrcs.size()); 263 EXPECT_EQ(config.rtp.rtx.ssrcs.size(), parsed_config.rtp.rtx.ssrcs.size());
264 for (size_t i = 0; i < config.rtp.rtx.ssrcs.size(); i++) { 264 for (size_t i = 0; i < config.rtp.rtx.ssrcs.size(); i++) {
265 EXPECT_EQ(config.rtp.rtx.ssrcs[i], parsed_config.rtp.rtx.ssrcs[i]); 265 EXPECT_EQ(config.rtp.rtx.ssrcs[i], parsed_config.rtp.rtx.ssrcs[i]);
266 } 266 }
267 EXPECT_EQ(config.rtp.rtx.payload_type, parsed_config.rtp.rtx.payload_type); 267 EXPECT_EQ(config.rtp.rtx.payload_type, parsed_config.rtp.rtx.payload_type);
268 // Check encoder. 268 // Check encoder.
269 EXPECT_EQ(config.encoder_settings.payload_name, 269 EXPECT_EQ(config.encoder_settings.payload_name,
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 const ParsedRtcEventLog& parsed_log, 400 const ParsedRtcEventLog& parsed_log,
401 size_t index) { 401 size_t index) {
402 const rtclog::Event& event = parsed_log.stream_[index]; 402 const rtclog::Event& event = parsed_log.stream_[index];
403 ASSERT_TRUE(IsValidBasicEvent(event)); 403 ASSERT_TRUE(IsValidBasicEvent(event));
404 EXPECT_EQ(rtclog::Event::LOG_END, event.type()); 404 EXPECT_EQ(rtclog::Event::LOG_END, event.type());
405 } 405 }
406 406
407 } // namespace webrtc 407 } // namespace webrtc
408 408
409 #endif // ENABLE_RTC_EVENT_LOG 409 #endif // ENABLE_RTC_EVENT_LOG
OLDNEW
« no previous file with comments | « webrtc/call/rtc_event_log_unittest.cc ('k') | webrtc/config.h » ('j') | webrtc/pc/mediasession.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698