Commit 84ae0017 authored by Sergei Istomin's avatar Sergei Istomin Committed by Commit Bot

Fix cast_audio_backend unittest crashing on biggie

Biggie device has post processing configuration for 4 channels. If
ResetPostProcessorsForTest() is called channels number should be set by
SetNumOutputChannelsForTest() as well.

Bug: internal b/118631518
Test: Unittests.
Change-Id: Ia04f890bbcca18df702496db49432e36b2bd9b65
Reviewed-on: https://chromium-review.googlesource.com/c/1312987Reviewed-by: default avatarKenneth MacKay <kmackay@chromium.org>
Commit-Queue: Sergei Istomin <sistomin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#604730}
parent 748888c0
...@@ -164,6 +164,8 @@ TEST_F(ExternalAudioPipelineTest, ExternalAudioPipelineLoopbackData) { ...@@ -164,6 +164,8 @@ TEST_F(ExternalAudioPipelineTest, ExternalAudioPipelineLoopbackData) {
mixer_->SetVolume(AudioContentType::kMedia, 1); mixer_->SetVolume(AudioContentType::kMedia, 1);
// Add fake postprocessor to override test configuration running on device. // Add fake postprocessor to override test configuration running on device.
const int kNumChannels = 2;
mixer_->SetNumOutputChannelsForTest(kNumChannels);
mixer_->ResetPostProcessorsForTest( mixer_->ResetPostProcessorsForTest(
std::make_unique<MockPostProcessorFactory>(), "{}"); std::make_unique<MockPostProcessorFactory>(), "{}");
...@@ -187,7 +189,6 @@ TEST_F(ExternalAudioPipelineTest, ExternalAudioPipelineLoopbackData) { ...@@ -187,7 +189,6 @@ TEST_F(ExternalAudioPipelineTest, ExternalAudioPipelineLoopbackData) {
test_data[i] = i; test_data[i] = i;
// Set test data in AudioBus. // Set test data in AudioBus.
const int kNumChannels = 2;
const auto kNumFrames = kSampleSize / kNumChannels; const auto kNumFrames = kSampleSize / kNumChannels;
auto data = ::media::AudioBus::Create(kNumChannels, kNumFrames); auto data = ::media::AudioBus::Create(kNumChannels, kNumFrames);
const size_t kBytesPerSample = sizeof(test_data[0]); const size_t kBytesPerSample = sizeof(test_data[0]);
......
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