Commit e5e6b675 authored by Sergey Volk's avatar Sergey Volk Committed by Commit Bot

[Chromecast] cast_media_unittest cleanup

Removed SetConfig for optional audio codecs, those are useless and
only produce noise in test logs. Also marked PCM/PCM_16BE as mandatory.

Bug: none
Test: cast_media_unittests
Change-Id: I73ea213f109e1bbc26194a88a09d946db47ce346
Reviewed-on: https://chromium-review.googlesource.com/810124
Commit-Queue: Sergey Volk <servolk@chromium.org>
Reviewed-by: default avatarKenneth MacKay <kmackay@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521972}
parent c91d6267
...@@ -477,6 +477,12 @@ void BufferFeeder::TestAudioConfigs() { ...@@ -477,6 +477,12 @@ void BufferFeeder::TestAudioConfigs() {
// TODO(kmackay) Determine required sample formats/channel numbers. // TODO(kmackay) Determine required sample formats/channel numbers.
config.sample_format = kSampleFormatS16; config.sample_format = kSampleFormatS16;
config.bytes_per_channel = 2; config.bytes_per_channel = 2;
config.codec = kCodecPCM;
EXPECT_TRUE(audio_decoder->SetConfig(config))
<< "Audio decoder does not accept kCodecPCM";
config.codec = kCodecPCM_S16BE;
EXPECT_TRUE(audio_decoder->SetConfig(config))
<< "Audio decoder does not accept kCodecPCM_S16BE";
config.codec = kCodecAAC; config.codec = kCodecAAC;
EXPECT_TRUE(audio_decoder->SetConfig(config)) EXPECT_TRUE(audio_decoder->SetConfig(config))
<< "Audio decoder does not accept kCodecAAC"; << "Audio decoder does not accept kCodecAAC";
...@@ -484,24 +490,6 @@ void BufferFeeder::TestAudioConfigs() { ...@@ -484,24 +490,6 @@ void BufferFeeder::TestAudioConfigs() {
EXPECT_TRUE(audio_decoder->SetConfig(config)) EXPECT_TRUE(audio_decoder->SetConfig(config))
<< "Audio decoder does not accept kCodecMP3"; << "Audio decoder does not accept kCodecMP3";
// Test optional codecs.
// TODO(kmackay) Make sure other parts of config are correct for each codec.
config.codec = kCodecPCM_S16BE;
if (!audio_decoder->SetConfig(config))
LOG(INFO) << "Audio decoder does not accept kCodecPCM_S16BE";
config.codec = kCodecOpus;
if (!audio_decoder->SetConfig(config))
LOG(INFO) << "Audio decoder does not accept kCodecOpus";
config.codec = kCodecEAC3;
if (!audio_decoder->SetConfig(config))
LOG(INFO) << "Audio decoder does not accept kCodecEAC3";
config.codec = kCodecAC3;
if (!audio_decoder->SetConfig(config))
LOG(INFO) << "Audio decoder does not accept kCodecAC3";
config.codec = kCodecFLAC;
if (!audio_decoder->SetConfig(config))
LOG(INFO) << "Audio decoder does not accept kCodecFLAC";
// Test supported sample rates. // Test supported sample rates.
const int kRequiredSampleRates[] = {8000, 11025, 12000, 16000, 22050, const int kRequiredSampleRates[] = {8000, 11025, 12000, 16000, 22050,
24000, 32000, 44100, 48000}; 24000, 32000, 44100, 48000};
...@@ -534,11 +522,12 @@ void BufferFeeder::TestAudioVolume() { ...@@ -534,11 +522,12 @@ void BufferFeeder::TestAudioVolume() {
void BufferFeeder::TestVideoConfigs() { void BufferFeeder::TestVideoConfigs() {
MediaPipelineBackend::VideoDecoder* video_decoder = MediaPipelineBackend::VideoDecoder* video_decoder =
static_cast<MediaPipelineBackend::VideoDecoder*>(decoder_); static_cast<MediaPipelineBackend::VideoDecoder*>(decoder_);
VideoConfig config;
config.codec = kVideoCodecUnknown;
// Set invalid config first, to test that the decoder still accepts valid // Set invalid config first, to test that the decoder still accepts valid
// config after an invalid config. // config after an invalid config.
VideoConfig config;
config.codec = kVideoCodecUnknown;
video_decoder->SetConfig(config); video_decoder->SetConfig(config);
EXPECT_TRUE(video_decoder->SetConfig(video_config_)); EXPECT_TRUE(video_decoder->SetConfig(video_config_));
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment