#include "content/browser/speech/fake_speech_recognition_manager_delegate.h"
#include "base/notimplemented.h"
#include "base/run_loop.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/speech_recognition_manager_delegate.h"
#include "media/mojo/mojom/audio_data.mojom.h"
#include "media/mojo/mojom/speech_recognition.mojom.h"
#include "media/mojo/mojom/speech_recognition_service.mojom.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace content {
MockSodaInstaller::MockSodaInstaller() = default;
MockSodaInstaller::~MockSodaInstaller() = default;
MockOnDeviceWebSpeechRecognitionService::
MockOnDeviceWebSpeechRecognitionService(
content::BrowserContext* browser_context)
: … { … }
MockOnDeviceWebSpeechRecognitionService::
~MockOnDeviceWebSpeechRecognitionService() = default;
void MockOnDeviceWebSpeechRecognitionService::BindSpeechRecognitionContext(
mojo::PendingReceiver<media::mojom::SpeechRecognitionContext> receiver) { … }
void MockOnDeviceWebSpeechRecognitionService::BindRecognizer(
mojo::PendingReceiver<media::mojom::SpeechRecognitionRecognizer> receiver,
mojo::PendingRemote<media::mojom::SpeechRecognitionRecognizerClient> client,
media::mojom::SpeechRecognitionOptionsPtr options,
BindRecognizerCallback callback) { … }
void MockOnDeviceWebSpeechRecognitionService::BindWebSpeechRecognizer(
mojo::PendingReceiver<media::mojom::SpeechRecognitionSession>
session_receiver,
mojo::PendingRemote<media::mojom::SpeechRecognitionSessionClient>
session_client,
mojo::PendingReceiver<media::mojom::SpeechRecognitionAudioForwarder>
audio_forwarder,
int channel_count,
int sample_rate,
media::mojom::SpeechRecognitionOptionsPtr options,
bool continuous) { … }
void MockOnDeviceWebSpeechRecognitionService::MarkDone() { … }
void MockOnDeviceWebSpeechRecognitionService::SendSpeechRecognitionResult(
const media::SpeechRecognitionResult& result) { … }
void MockOnDeviceWebSpeechRecognitionService::SendSpeechRecognitionError() { … }
void MockOnDeviceWebSpeechRecognitionService::OnRecognizerClientDisconnected() { … }
void MockOnDeviceWebSpeechRecognitionService::
OnSpeechRecognitionRecognitionEventCallback(bool success) { … }
void FakeSpeechRecognitionManagerDelegate::CheckRecognitionIsAllowed(
int session_id,
base::OnceCallback<void(bool ask_user, bool is_allowed)> callback) { … }
SpeechRecognitionEventListener*
FakeSpeechRecognitionManagerDelegate::GetEventListener() { … }
void FakeSpeechRecognitionManagerDelegate::BindSpeechRecognitionContext(
mojo::PendingReceiver<media::mojom::SpeechRecognitionContext> receiver) { … }
void FakeSpeechRecognitionManagerDelegate::Reset(
MockOnDeviceWebSpeechRecognitionService* service) { … }
}