Chromium Code Reviews| Index: media/audio/win/core_audio_util_win_unittest.cc |
| diff --git a/media/audio/win/core_audio_util_win_unittest.cc b/media/audio/win/core_audio_util_win_unittest.cc |
| index c2308722a93e07436b33330946a7a68b6d61d239..6d3e1fcf09381b1eddad7c3889979644c84a75a4 100644 |
| --- a/media/audio/win/core_audio_util_win_unittest.cc |
| +++ b/media/audio/win/core_audio_util_win_unittest.cc |
| @@ -232,6 +232,33 @@ TEST_F(CoreAudioUtilWinTest, GetSharedModeMixFormat) { |
| EXPECT_EQ(format.Format.wFormatTag, WAVE_FORMAT_EXTENSIBLE); |
| } |
| +TEST_F(CoreAudioUtilWinTest, IsChannelLayoutSupported) { |
| + if (!CanRunAudioTest()) |
| + return; |
| + |
| + // The preferred channel layout should always be supported. Being supported |
| + // means that it is possible to initialize a shared mode stream with the |
| + // particular channel layout. |
| + AudioParameters mix_params; |
| + HRESULT hr = CoreAudioUtil::GetPreferredAudioParameters(eRender, eConsole, |
| + &mix_params); |
| + EXPECT_TRUE(SUCCEEDED(hr)); |
| + EXPECT_TRUE(mix_params.IsValid()); |
| + EXPECT_TRUE(CoreAudioUtil::IsChannelLayoutSupported( |
| + eRender, eConsole, mix_params.channel_layout())); |
| + |
| + // Check if it is possible to modify the channel layout to stereo for a |
| + // device which reports that it prefers to be openen up in an other |
| + // channel configuration. |
| + if (mix_params.channel_layout() != CHANNEL_LAYOUT_STEREO) { |
| + ChannelLayout channel_layout = CHANNEL_LAYOUT_STEREO; |
| + // TODO(henrika): it might be too pessimistic to assume false as return |
| + // value here. |
| + EXPECT_FALSE(CoreAudioUtil::IsChannelLayoutSupported( |
|
DaleCurtis
2013/03/27 17:30:18
Heh. I'll take a private build back to my place to
henrika (OOO until Aug 14)
2013/03/28 09:15:05
Thanks. I will check when I receive my device as w
|
| + eRender, eConsole, channel_layout)); |
| + } |
| +} |
| + |
| TEST_F(CoreAudioUtilWinTest, GetDevicePeriod) { |
| if (!CanRunAudioTest()) |
| return; |