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

Unified Diff: media/audio/win/core_audio_util_win_unittest.cc

Issue 12918026: Adds support for CoreAudioUtil::IsChannelLayoutSupported() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nit Created 7 years, 9 months 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 | « media/audio/win/core_audio_util_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
+ eRender, eConsole, channel_layout));
+ }
+}
+
TEST_F(CoreAudioUtilWinTest, GetDevicePeriod) {
if (!CanRunAudioTest())
return;
« no previous file with comments | « media/audio/win/core_audio_util_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698