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

Unified Diff: content/renderer/media/audio_renderer_mixer_manager_unittest.cc

Issue 1483433003: Second layer of mixing for audio elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: That fix Created 5 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/media/audio_renderer_mixer_manager.cc ('k') | media/audio/virtual_audio_input_stream.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/audio_renderer_mixer_manager_unittest.cc
diff --git a/content/renderer/media/audio_renderer_mixer_manager_unittest.cc b/content/renderer/media/audio_renderer_mixer_manager_unittest.cc
index fd776bde2b6491b4125c98aae2e7e12c828eadcb..bfc0f9f0d01785cffaebdafd872d75102853882c 100644
--- a/content/renderer/media/audio_renderer_mixer_manager_unittest.cc
+++ b/content/renderer/media/audio_renderer_mixer_manager_unittest.cc
@@ -22,6 +22,8 @@ static const int kBitsPerChannel = 16;
static const int kSampleRate = 48000;
static const int kBufferSize = 8192;
static const media::ChannelLayout kChannelLayout = media::CHANNEL_LAYOUT_STEREO;
+static const media::ChannelLayout kAnotherChannelLayout =
+ media::CHANNEL_LAYOUT_2_1;
static const std::string kDefaultDeviceId;
static const url::Origin kSecurityOrigin;
@@ -108,7 +110,7 @@ TEST_F(AudioRendererMixerManagerTest, GetRemoveMixer) {
EXPECT_EQ(mixer_count(), 1);
media::AudioParameters params2(
- AudioParameters::AUDIO_PCM_LINEAR, kChannelLayout, kSampleRate * 2,
+ AudioParameters::AUDIO_PCM_LINEAR, kAnotherChannelLayout, kSampleRate * 2,
kBitsPerChannel, kBufferSize * 2);
media::AudioRendererMixer* mixer2 = GetMixer(
kRenderFrameId, params2, kDefaultDeviceId, kSecurityOrigin, nullptr);
@@ -142,21 +144,25 @@ TEST_F(AudioRendererMixerManagerTest, MixerReuse) {
ASSERT_TRUE(mixer1);
EXPECT_EQ(mixer_count(), 1);
- // Different formats, bit depths, and buffer sizes should not result in a
- // different mixer.
+ // Different sample rates, formats, bit depths, and buffer sizes should not
+ // result in a different mixer.
media::AudioParameters params2(AudioParameters::AUDIO_PCM_LOW_LATENCY,
- kChannelLayout, kSampleRate,
- kBitsPerChannel * 2, kBufferSize * 2);
+ kChannelLayout,
+ kSampleRate * 2,
+ kBitsPerChannel * 2,
+ kBufferSize * 2);
EXPECT_EQ(mixer1, GetMixer(kRenderFrameId, params2, kDefaultDeviceId,
kSecurityOrigin, nullptr));
EXPECT_EQ(mixer_count(), 1);
RemoveMixer(kRenderFrameId, params2, kDefaultDeviceId, kSecurityOrigin);
EXPECT_EQ(mixer_count(), 1);
- // Modify some parameters that do matter.
+ // Modify some parameters that do matter: channel layout
media::AudioParameters params3(AudioParameters::AUDIO_PCM_LOW_LATENCY,
- media::CHANNEL_LAYOUT_MONO, kSampleRate * 2,
- kBitsPerChannel, kBufferSize);
+ kAnotherChannelLayout,
+ kSampleRate,
+ kBitsPerChannel,
+ kBufferSize);
ASSERT_NE(params3.channel_layout(), params1.channel_layout());
EXPECT_NE(mixer1, GetMixer(kRenderFrameId, params3, kDefaultDeviceId,
« no previous file with comments | « content/renderer/media/audio_renderer_mixer_manager.cc ('k') | media/audio/virtual_audio_input_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698