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

Unified Diff: media/audio/audio_input_controller_unittest.cc

Issue 13288002: Revert 190475 "Merge 189983 "Add speaker on/off control on Andro..." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1410/src/
Patch Set: 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 | « content/test/webrtc_audio_device_test.cc ('k') | media/audio/audio_input_device_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/audio_input_controller_unittest.cc
===================================================================
--- media/audio/audio_input_controller_unittest.cc (revision 191282)
+++ media/audio/audio_input_controller_unittest.cc (working copy)
@@ -11,11 +11,6 @@
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
-#if defined(OS_ANDROID)
-#include "base/android/jni_android.h"
-#include "media/audio/audio_manager_base.h"
-#endif
-
using ::testing::_;
using ::testing::AtLeast;
using ::testing::Exactly;
@@ -70,13 +65,6 @@
virtual ~AudioInputControllerTest() {}
protected:
- virtual void SetUp() {
-#if defined(OS_ANDROID)
- media::AudioManagerBase::RegisterAudioManager(
- base::android::AttachCurrentThread());
-#endif
- }
-
MessageLoop message_loop_;
private:
@@ -84,7 +72,14 @@
};
// Test AudioInputController for create and close without recording audio.
-TEST_F(AudioInputControllerTest, CreateAndClose) {
+// TODO(leozwang): Because java calls were introduced in audio_manager_base,
+// unit test has to register jni first, else it will crash.
+#if defined(OS_ANDROID)
+#define MAYBE_CreateAndClose DISABLED_CreateAndClose
+#else
+#define MAYBE_CreateAndClose CreateAndClose
+#endif
+TEST_F(AudioInputControllerTest, MAYBE_CreateAndClose) {
MockAudioInputControllerEventHandler event_handler;
// OnCreated() will be posted once.
@@ -106,7 +101,14 @@
}
// Test a normal call sequence of create, record and close.
-TEST_F(AudioInputControllerTest, RecordAndClose) {
+// TODO(leozwang): Because java calls were introduced in audio_manager_base,
+// unit test has to register jni first, else it will crash.
+#if defined(OS_ANDROID)
+#define MAYBE_RecordAndClose DISABLED_RecordAndClose
+#else
+#define MAYBE_RecordAndClose RecordAndClose
+#endif
+TEST_F(AudioInputControllerTest, MAYBE_RecordAndClose) {
MockAudioInputControllerEventHandler event_handler;
int count = 0;
@@ -146,7 +148,14 @@
// Test that the AudioInputController reports an error when the input stream
// stops without an OnClose() callback. This can happen when the underlying
// audio layer stops feeding data as a result of a removed microphone device.
-TEST_F(AudioInputControllerTest, RecordAndError) {
+// TODO(leozwang): Because java calls were introduced in audio_manager_base,
+// unit test has to register jni first to make unit test run.
+#if defined(OS_ANDROID)
+#define MAYBE_RecordAndError DISABLED_RecordAndError
+#else
+#define MAYBE_RecordAndError RecordAndError
+#endif
+TEST_F(AudioInputControllerTest, MAYBE_RecordAndError) {
MockAudioInputControllerEventHandler event_handler;
int count = 0;
@@ -212,7 +221,12 @@
}
// Test calling AudioInputController::Close multiple times.
-TEST_F(AudioInputControllerTest, CloseTwice) {
+#if defined(OS_ANDROID)
+#define MAYBE_CloseTwice DISABLED_CloseTwice
+#else
+#define MAYBE_CloseTwice CloseTwice
+#endif
+TEST_F(AudioInputControllerTest, MAYBE_CloseTwice) {
MockAudioInputControllerEventHandler event_handler;
// OnRecording() will be called only once.
« no previous file with comments | « content/test/webrtc_audio_device_test.cc ('k') | media/audio/audio_input_device_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698