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

Side by Side Diff: webrtc/modules/audio_coding/neteq/neteq_network_stats_unittest.cc

Issue 2809153002: Change from WebRtcRTPHeader to RTPHeader in NetEq tests and tools (Closed)
Patch Set: Fixing neteq_rtp_fuzzer Created 3 years, 8 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) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 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
11 #include <memory> 11 #include <memory>
12 12
13 #include "webrtc/common_types.h"
13 #include "webrtc/modules/audio_coding/neteq/tools/neteq_external_decoder_test.h" 14 #include "webrtc/modules/audio_coding/neteq/tools/neteq_external_decoder_test.h"
14 #include "webrtc/modules/audio_coding/neteq/tools/rtp_generator.h" 15 #include "webrtc/modules/audio_coding/neteq/tools/rtp_generator.h"
15 #include "webrtc/modules/include/module_common_types.h" 16 #include "webrtc/modules/include/module_common_types.h"
16 #include "webrtc/test/gmock.h" 17 #include "webrtc/test/gmock.h"
17 18
18 namespace webrtc { 19 namespace webrtc {
19 namespace test { 20 namespace test {
20 21
21 using ::testing::_; 22 using ::testing::_;
22 using ::testing::SetArgPointee; 23 using ::testing::SetArgPointee;
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 expects.stats_ref.expand_rate = 16384; 298 expects.stats_ref.expand_rate = 16384;
298 expects.stats_ref.speech_expand_rate = 5324; 299 expects.stats_ref.speech_expand_rate = 5324;
299 RunTest(10, expects); // Lost 10 * 20ms in a row. 300 RunTest(10, expects); // Lost 10 * 20ms in a row.
300 } 301 }
301 302
302 private: 303 private:
303 MockAudioDecoder* external_decoder_; 304 MockAudioDecoder* external_decoder_;
304 const int samples_per_ms_; 305 const int samples_per_ms_;
305 const size_t frame_size_samples_; 306 const size_t frame_size_samples_;
306 std::unique_ptr<test::RtpGenerator> rtp_generator_; 307 std::unique_ptr<test::RtpGenerator> rtp_generator_;
307 WebRtcRTPHeader rtp_header_; 308 RTPHeader rtp_header_;
308 uint32_t last_lost_time_; 309 uint32_t last_lost_time_;
309 uint32_t packet_loss_interval_; 310 uint32_t packet_loss_interval_;
310 AudioFrame output_frame_; 311 AudioFrame output_frame_;
311 }; 312 };
312 313
313 TEST(NetEqNetworkStatsTest, DecodeFec) { 314 TEST(NetEqNetworkStatsTest, DecodeFec) {
314 MockAudioDecoder decoder(48000, 1); 315 MockAudioDecoder decoder(48000, 1);
315 NetEqNetworkStatsTest test(NetEqDecoder::kDecoderOpus, 48000, &decoder); 316 NetEqNetworkStatsTest test(NetEqDecoder::kDecoderOpus, 48000, &decoder);
316 test.DecodeFecTest(); 317 test.DecodeFecTest();
317 EXPECT_CALL(decoder, Die()).Times(1); 318 EXPECT_CALL(decoder, Die()).Times(1);
318 } 319 }
319 320
320 TEST(NetEqNetworkStatsTest, StereoDecodeFec) { 321 TEST(NetEqNetworkStatsTest, StereoDecodeFec) {
321 MockAudioDecoder decoder(48000, 2); 322 MockAudioDecoder decoder(48000, 2);
322 NetEqNetworkStatsTest test(NetEqDecoder::kDecoderOpus, 48000, &decoder); 323 NetEqNetworkStatsTest test(NetEqDecoder::kDecoderOpus, 48000, &decoder);
323 test.DecodeFecTest(); 324 test.DecodeFecTest();
324 EXPECT_CALL(decoder, Die()).Times(1); 325 EXPECT_CALL(decoder, Die()).Times(1);
325 } 326 }
326 327
327 TEST(NetEqNetworkStatsTest, NoiseExpansionTest) { 328 TEST(NetEqNetworkStatsTest, NoiseExpansionTest) {
328 MockAudioDecoder decoder(48000, 1); 329 MockAudioDecoder decoder(48000, 1);
329 NetEqNetworkStatsTest test(NetEqDecoder::kDecoderOpus, 48000, &decoder); 330 NetEqNetworkStatsTest test(NetEqDecoder::kDecoderOpus, 48000, &decoder);
330 test.NoiseExpansionTest(); 331 test.NoiseExpansionTest();
331 EXPECT_CALL(decoder, Die()).Times(1); 332 EXPECT_CALL(decoder, Die()).Times(1);
332 } 333 }
333 334
334 } // namespace test 335 } // namespace test
335 } // namespace webrtc 336 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_coding/neteq/neteq_impl_unittest.cc ('k') | webrtc/modules/audio_coding/neteq/neteq_stereo_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698