| Index: content/browser/speech/speech_recognizer_impl_unittest.cc
|
| diff --git a/content/browser/speech/speech_recognizer_impl_unittest.cc b/content/browser/speech/speech_recognizer_impl_unittest.cc
|
| index 1675e2e67d3fe696f4121cd3e404e06e0a1cc65e..6135e4a48742116b0c2dea096bbfc6131dd8b3f8 100644
|
| --- a/content/browser/speech/speech_recognizer_impl_unittest.cc
|
| +++ b/content/browser/speech/speech_recognizer_impl_unittest.cc
|
| @@ -13,7 +13,7 @@
|
| #include "content/browser/speech/speech_recognizer_impl.h"
|
| #include "content/public/browser/speech_recognition_event_listener.h"
|
| #include "content/public/test/test_browser_thread_bundle.h"
|
| -#include "media/audio/audio_manager_base.h"
|
| +#include "media/audio/audio_device_description.h"
|
| #include "media/audio/fake_audio_input_stream.h"
|
| #include "media/audio/fake_audio_output_stream.h"
|
| #include "media/audio/mock_audio_manager.h"
|
| @@ -204,7 +204,8 @@ class SpeechRecognizerImplTest : public SpeechRecognitionEventListener,
|
|
|
| TEST_F(SpeechRecognizerImplTest, StopNoData) {
|
| // Check for callbacks when stopping record before any audio gets recorded.
|
| - recognizer_->StartRecognition(media::AudioManagerBase::kDefaultDeviceId);
|
| + recognizer_->StartRecognition(
|
| + media::AudioDeviceDescription::kDefaultDeviceId);
|
| recognizer_->StopAudioCapture();
|
| base::MessageLoop::current()->RunUntilIdle();
|
| EXPECT_TRUE(recognition_started_);
|
| @@ -217,7 +218,8 @@ TEST_F(SpeechRecognizerImplTest, StopNoData) {
|
| TEST_F(SpeechRecognizerImplTest, CancelNoData) {
|
| // Check for callbacks when canceling recognition before any audio gets
|
| // recorded.
|
| - recognizer_->StartRecognition(media::AudioManagerBase::kDefaultDeviceId);
|
| + recognizer_->StartRecognition(
|
| + media::AudioDeviceDescription::kDefaultDeviceId);
|
| recognizer_->AbortRecognition();
|
| base::MessageLoop::current()->RunUntilIdle();
|
| EXPECT_TRUE(recognition_started_);
|
| @@ -230,7 +232,8 @@ TEST_F(SpeechRecognizerImplTest, CancelNoData) {
|
| TEST_F(SpeechRecognizerImplTest, StopWithData) {
|
| // Start recording, give some data and then stop. This should wait for the
|
| // network callback to arrive before completion.
|
| - recognizer_->StartRecognition(media::AudioManagerBase::kDefaultDeviceId);
|
| + recognizer_->StartRecognition(
|
| + media::AudioDeviceDescription::kDefaultDeviceId);
|
| base::MessageLoop::current()->RunUntilIdle();
|
| TestAudioInputController* controller =
|
| audio_input_controller_factory_.controller();
|
| @@ -291,7 +294,8 @@ TEST_F(SpeechRecognizerImplTest, StopWithData) {
|
|
|
| TEST_F(SpeechRecognizerImplTest, CancelWithData) {
|
| // Start recording, give some data and then cancel.
|
| - recognizer_->StartRecognition(media::AudioManagerBase::kDefaultDeviceId);
|
| + recognizer_->StartRecognition(
|
| + media::AudioDeviceDescription::kDefaultDeviceId);
|
| base::MessageLoop::current()->RunUntilIdle();
|
| TestAudioInputController* controller =
|
| audio_input_controller_factory_.controller();
|
| @@ -311,7 +315,8 @@ TEST_F(SpeechRecognizerImplTest, CancelWithData) {
|
| TEST_F(SpeechRecognizerImplTest, ConnectionError) {
|
| // Start recording, give some data and then stop. Issue the network callback
|
| // with a connection error and verify that the recognizer bubbles the error up
|
| - recognizer_->StartRecognition(media::AudioManagerBase::kDefaultDeviceId);
|
| + recognizer_->StartRecognition(
|
| + media::AudioDeviceDescription::kDefaultDeviceId);
|
| base::MessageLoop::current()->RunUntilIdle();
|
| TestAudioInputController* controller =
|
| audio_input_controller_factory_.controller();
|
| @@ -346,7 +351,8 @@ TEST_F(SpeechRecognizerImplTest, ConnectionError) {
|
| TEST_F(SpeechRecognizerImplTest, ServerError) {
|
| // Start recording, give some data and then stop. Issue the network callback
|
| // with a 500 error and verify that the recognizer bubbles the error up
|
| - recognizer_->StartRecognition(media::AudioManagerBase::kDefaultDeviceId);
|
| + recognizer_->StartRecognition(
|
| + media::AudioDeviceDescription::kDefaultDeviceId);
|
| base::MessageLoop::current()->RunUntilIdle();
|
| TestAudioInputController* controller =
|
| audio_input_controller_factory_.controller();
|
| @@ -379,7 +385,8 @@ TEST_F(SpeechRecognizerImplTest, ServerError) {
|
|
|
| TEST_F(SpeechRecognizerImplTest, AudioControllerErrorNoData) {
|
| // Check if things tear down properly if AudioInputController threw an error.
|
| - recognizer_->StartRecognition(media::AudioManagerBase::kDefaultDeviceId);
|
| + recognizer_->StartRecognition(
|
| + media::AudioDeviceDescription::kDefaultDeviceId);
|
| base::MessageLoop::current()->RunUntilIdle();
|
| TestAudioInputController* controller =
|
| audio_input_controller_factory_.controller();
|
| @@ -397,7 +404,8 @@ TEST_F(SpeechRecognizerImplTest, AudioControllerErrorNoData) {
|
| TEST_F(SpeechRecognizerImplTest, AudioControllerErrorWithData) {
|
| // Check if things tear down properly if AudioInputController threw an error
|
| // after giving some audio data.
|
| - recognizer_->StartRecognition(media::AudioManagerBase::kDefaultDeviceId);
|
| + recognizer_->StartRecognition(
|
| + media::AudioDeviceDescription::kDefaultDeviceId);
|
| base::MessageLoop::current()->RunUntilIdle();
|
| TestAudioInputController* controller =
|
| audio_input_controller_factory_.controller();
|
| @@ -417,7 +425,8 @@ TEST_F(SpeechRecognizerImplTest, AudioControllerErrorWithData) {
|
| TEST_F(SpeechRecognizerImplTest, NoSpeechCallbackIssued) {
|
| // Start recording and give a lot of packets with audio samples set to zero.
|
| // This should trigger the no-speech detector and issue a callback.
|
| - recognizer_->StartRecognition(media::AudioManagerBase::kDefaultDeviceId);
|
| + recognizer_->StartRecognition(
|
| + media::AudioDeviceDescription::kDefaultDeviceId);
|
| base::MessageLoop::current()->RunUntilIdle();
|
| TestAudioInputController* controller =
|
| audio_input_controller_factory_.controller();
|
| @@ -442,7 +451,8 @@ TEST_F(SpeechRecognizerImplTest, NoSpeechCallbackNotIssued) {
|
| // and then some more with reasonably loud audio samples. This should be
|
| // treated as normal speech input and the no-speech detector should not get
|
| // triggered.
|
| - recognizer_->StartRecognition(media::AudioManagerBase::kDefaultDeviceId);
|
| + recognizer_->StartRecognition(
|
| + media::AudioDeviceDescription::kDefaultDeviceId);
|
| base::MessageLoop::current()->RunUntilIdle();
|
| TestAudioInputController* controller =
|
| audio_input_controller_factory_.controller();
|
| @@ -478,7 +488,8 @@ TEST_F(SpeechRecognizerImplTest, SetInputVolumeCallback) {
|
| // and then some more with reasonably loud audio samples. Check that we don't
|
| // get the callback during estimation phase, then get zero for the silence
|
| // samples and proper volume for the loud audio.
|
| - recognizer_->StartRecognition(media::AudioManagerBase::kDefaultDeviceId);
|
| + recognizer_->StartRecognition(
|
| + media::AudioDeviceDescription::kDefaultDeviceId);
|
| base::MessageLoop::current()->RunUntilIdle();
|
| TestAudioInputController* controller =
|
| audio_input_controller_factory_.controller();
|
|
|