OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <deque> | 5 #include <deque> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/format_macros.h" | 8 #include "base/format_macros.h" |
9 #include "base/md5.h" | 9 #include "base/md5.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 } | 371 } |
372 | 372 |
373 TEST_P(OpusAudioDecoderBehavioralTest, InitializeWithNoCodecDelay) { | 373 TEST_P(OpusAudioDecoderBehavioralTest, InitializeWithNoCodecDelay) { |
374 ASSERT_EQ(GetParam().decoder_type, OPUS); | 374 ASSERT_EQ(GetParam().decoder_type, OPUS); |
375 AudioDecoderConfig decoder_config; | 375 AudioDecoderConfig decoder_config; |
376 decoder_config.Initialize(kCodecOpus, | 376 decoder_config.Initialize(kCodecOpus, |
377 kSampleFormatF32, | 377 kSampleFormatF32, |
378 CHANNEL_LAYOUT_STEREO, | 378 CHANNEL_LAYOUT_STEREO, |
379 48000, | 379 48000, |
380 kOpusExtraData, | 380 kOpusExtraData, |
381 ARRAYSIZE_UNSAFE(kOpusExtraData), | 381 arraysize(kOpusExtraData), |
382 false, | 382 false, |
383 false, | 383 false, |
384 base::TimeDelta::FromMilliseconds(80), | 384 base::TimeDelta::FromMilliseconds(80), |
385 0); | 385 0); |
386 InitializeDecoder(decoder_config); | 386 InitializeDecoder(decoder_config); |
387 } | 387 } |
388 | 388 |
389 TEST_P(OpusAudioDecoderBehavioralTest, InitializeWithBadCodecDelay) { | 389 TEST_P(OpusAudioDecoderBehavioralTest, InitializeWithBadCodecDelay) { |
390 ASSERT_EQ(GetParam().decoder_type, OPUS); | 390 ASSERT_EQ(GetParam().decoder_type, OPUS); |
391 AudioDecoderConfig decoder_config; | 391 AudioDecoderConfig decoder_config; |
392 decoder_config.Initialize( | 392 decoder_config.Initialize( |
393 kCodecOpus, | 393 kCodecOpus, |
394 kSampleFormatF32, | 394 kSampleFormatF32, |
395 CHANNEL_LAYOUT_STEREO, | 395 CHANNEL_LAYOUT_STEREO, |
396 48000, | 396 48000, |
397 kOpusExtraData, | 397 kOpusExtraData, |
398 ARRAYSIZE_UNSAFE(kOpusExtraData), | 398 arraysize(kOpusExtraData), |
399 false, | 399 false, |
400 false, | 400 false, |
401 base::TimeDelta::FromMilliseconds(80), | 401 base::TimeDelta::FromMilliseconds(80), |
402 // Use a different codec delay than in the extradata. | 402 // Use a different codec delay than in the extradata. |
403 100); | 403 100); |
404 InitializeDecoderWithStatus(decoder_config, DECODER_ERROR_NOT_SUPPORTED); | 404 InitializeDecoderWithStatus(decoder_config, DECODER_ERROR_NOT_SUPPORTED); |
405 } | 405 } |
406 | 406 |
407 TEST_P(FFmpegAudioDecoderBehavioralTest, InitializeWithBadConfig) { | 407 TEST_P(FFmpegAudioDecoderBehavioralTest, InitializeWithBadConfig) { |
408 const AudioDecoderConfig decoder_config(kCodecVorbis, | 408 const AudioDecoderConfig decoder_config(kCodecVorbis, |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 }; | 522 }; |
523 | 523 |
524 INSTANTIATE_TEST_CASE_P(FFmpegAudioDecoderTest, | 524 INSTANTIATE_TEST_CASE_P(FFmpegAudioDecoderTest, |
525 AudioDecoderTest, | 525 AudioDecoderTest, |
526 testing::ValuesIn(kFFmpegTests)); | 526 testing::ValuesIn(kFFmpegTests)); |
527 INSTANTIATE_TEST_CASE_P(FFmpegAudioDecoderBehavioralTest, | 527 INSTANTIATE_TEST_CASE_P(FFmpegAudioDecoderBehavioralTest, |
528 FFmpegAudioDecoderBehavioralTest, | 528 FFmpegAudioDecoderBehavioralTest, |
529 testing::ValuesIn(kFFmpegBehavioralTest)); | 529 testing::ValuesIn(kFFmpegBehavioralTest)); |
530 | 530 |
531 } // namespace media | 531 } // namespace media |
OLD | NEW |