#include "content/browser/speech/speech_recognizer_impl.h"
#include <stddef.h>
#include <stdint.h>
#include <memory>
#include <vector>
#include "base/containers/span.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/ref_counted.h"
#include "base/numerics/byte_conversions.h"
#include "base/run_loop.h"
#include "base/synchronization/waitable_event.h"
#include "base/test/scoped_feature_list.h"
#include "base/threading/thread.h"
#include "content/browser/speech/network_speech_recognition_engine_impl.h"
#include "content/public/browser/google_streaming_api.pb.h"
#include "content/public/browser/speech_recognition_audio_forwarder_config.h"
#include "content/public/browser/speech_recognition_event_listener.h"
#include "content/public/common/content_features.h"
#include "content/public/test/browser_task_environment.h"
#include "media/audio/audio_device_description.h"
#include "media/audio/audio_system_impl.h"
#include "media/audio/fake_audio_input_stream.h"
#include "media/audio/fake_audio_output_stream.h"
#include "media/audio/mock_audio_manager.h"
#include "media/audio/test_audio_thread.h"
#include "media/base/audio_bus.h"
#include "media/base/audio_glitch_info.h"
#include "media/base/test_helpers.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "mojo/public/cpp/system/data_pipe.h"
#include "mojo/public/cpp/system/data_pipe_utils.h"
#include "net/base/net_errors.h"
#include "net/http/http_response_headers.h"
#include "net/http/http_util.h"
#include "services/network/public/cpp/url_loader_completion_status.h"
#include "services/network/public/cpp/weak_wrapper_shared_url_loader_factory.h"
#include "services/network/public/mojom/url_response_head.mojom.h"
#include "services/network/test/test_url_loader_factory.h"
#include "testing/gtest/include/gtest/gtest.h"
AudioInputStream;
AudioOutputStream;
AudioParameters;
namespace content {
namespace {
class MockCapturerSource : public media::AudioCapturerSource { … };
}
class SpeechRecognizerImplTest : public SpeechRecognitionEventListener,
public testing::Test { … };
TEST_F(SpeechRecognizerImplTest, StartNoInputDevices) { … }
TEST_F(SpeechRecognizerImplTest, StartFakeInputDevice) { … }
TEST_F(SpeechRecognizerImplTest, StopBeforeDeviceInfoReceived) { … }
TEST_F(SpeechRecognizerImplTest, CancelBeforeDeviceInfoReceived) { … }
TEST_F(SpeechRecognizerImplTest, StopNoData) { … }
TEST_F(SpeechRecognizerImplTest, CancelNoData) { … }
TEST_F(SpeechRecognizerImplTest, StopWithData) { … }
TEST_F(SpeechRecognizerImplTest, CancelWithData) { … }
TEST_F(SpeechRecognizerImplTest, ConnectionError) { … }
TEST_F(SpeechRecognizerImplTest, ServerError) { … }
TEST_F(SpeechRecognizerImplTest, OnCaptureError_PropagatesError) { … }
TEST_F(SpeechRecognizerImplTest, NoSpeechCallbackIssued) { … }
TEST_F(SpeechRecognizerImplTest, NoSpeechCallbackNotIssued) { … }
TEST_F(SpeechRecognizerImplTest, SetInputVolumeCallback) { … }
}