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

Unified Diff: media/audio/ios/audio_manager_ios_unittest.cc

Issue 10907110: Create iOS Audio Manager implementation. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Response to reviews Created 8 years, 3 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
Index: media/audio/ios/audio_manager_ios_unittest.cc
diff --git a/media/audio/ios/audio_manager_ios_unittest.cc b/media/audio/ios/audio_manager_ios_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..e8013cc241a946ea4d78d148c5226d5f7fa5280a
--- /dev/null
+++ b/media/audio/ios/audio_manager_ios_unittest.cc
@@ -0,0 +1,33 @@
+// Copyright 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/basictypes.h"
+#include "media/audio/audio_io.h"
+#include "media/audio/audio_manager.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+using namespace media;
+
+// Test that input is supported and output is not.
+TEST(IOSAudioTest, AudioSupport) {
+ AudioManager* audio_manager = AudioManager::Create();
+ ASSERT_TRUE(NULL != audio_manager);
+ ASSERT_FALSE(audio_manager->HasAudioOutputDevices());
+ ASSERT_TRUE(audio_manager->HasAudioInputDevices());
+}
+
+// Test that input stream can be opened and closed.
+TEST(IOSAudioTest, InputStreamOpenAndClose) {
+ AudioManager* audio_manager = AudioManager::Create();
+ ASSERT_TRUE(NULL != audio_manager);
+ if (!audio_manager->HasAudioInputDevices())
+ return;
+ AudioInputStream* ias = audio_manager->MakeAudioInputStream(
+ AudioParameters(AudioParameters::AUDIO_PCM_LINEAR, CHANNEL_LAYOUT_STEREO,
+ 8000, 16, 1024),
+ std::string("test_device"));
+ ASSERT_TRUE(NULL != ias);
+ EXPECT_TRUE(ias->Open());
+ ias->Close();
+}

Powered by Google App Engine
This is Rietveld 408576698