AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Classes | Namespaces | Typedefs | Functions | Variables
SpeechSynthesizerTest.cpp File Reference
#include <chrono>
#include <future>
#include <memory>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <acsdkApplicationAudioPipelineFactoryInterfaces/MockApplicationAudioPipelineFactory.h>
#include <AVSCommon/SDKInterfaces/MockExceptionEncounteredSender.h>
#include <AVSCommon/AVS/Attachment/AttachmentManagerInterface.h>
#include <AVSCommon/SDKInterfaces/MockContextManager.h>
#include <AVSCommon/SDKInterfaces/MockFocusManager.h>
#include <AVSCommon/SDKInterfaces/MockMessageSender.h>
#include <AVSCommon/SDKInterfaces/MockDirectiveSequencer.h>
#include <AVSCommon/SDKInterfaces/MockDirectiveHandlerResult.h>
#include <AVSCommon/SDKInterfaces/MockPowerResourceManager.h>
#include <AVSCommon/AVS/Attachment/AttachmentManager.h>
#include <AVSCommon/Utils/MediaPlayer/MockMediaPlayer.h>
#include <AVSCommon/Utils/Metrics/MockMetricRecorder.h>
#include <AVSCommon/Utils/JSON/JSONGenerator.h>
#include <MockCaptionManager.h>
#include "SpeechSynthesizer/SpeechSynthesizer.h"
Include dependency graph for SpeechSynthesizerTest.cpp:

Classes

struct  alexaClientSDK::capabilityAgents::speechSynthesizer::test::SpeakTestInfo
 
class  alexaClientSDK::capabilityAgents::speechSynthesizer::test::MockSpeechSynthesizerObserver
 
class  alexaClientSDK::capabilityAgents::speechSynthesizer::test::SpeechSynthesizerTest
 

Namespaces

 alexaClientSDK
 Whether or not curl logs should be emitted.
 
 alexaClientSDK::capabilityAgents
 
 alexaClientSDK::capabilityAgents::speechSynthesizer
 
 alexaClientSDK::capabilityAgents::speechSynthesizer::test
 

Typedefs

using alexaClientSDK::capabilityAgents::speechSynthesizer::test::MediaPlayerState = avsCommon::utils::mediaPlayer::MediaPlayerState
 
using alexaClientSDK::capabilityAgents::speechSynthesizer::test::PowerResourceLevel = PowerResourceManagerInterface::PowerResourceLevel
 

Functions

static const std::chrono::milliseconds alexaClientSDK::capabilityAgents::speechSynthesizer::test::MY_WAIT_TIMEOUT (1000)
 Plenty of time for a test to complete. More...
 
static const std::chrono::milliseconds alexaClientSDK::capabilityAgents::speechSynthesizer::test::STATE_CHANGE_TIMEOUT (10000)
 
static const std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::CHANNEL_NAME (avsCommon::sdkInterfaces::FocusManagerInterface::DIALOG_CHANNEL_NAME)
 The name of the FocusManager channel used by the SpeechSynthesizer. More...
 
static const std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::NAMESPACE_SPEECH_SYNTHESIZER ("SpeechSynthesizer")
 Namespace for SpeechSynthesizer. More...
 
static const std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::NAME_SPEAK ("Speak")
 Name for SpeechSynthesizer directive. More...
 
static const std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::NAME_RECOGNIZE ("Recognize")
 Wrong name for testing. More...
 
static const std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::MESSAGE_ID_TEST ("MessageId_Test")
 Message Id for testing. More...
 
static const std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::MESSAGE_ID_TEST_2 ("MessageId_Test_2")
 Message Id for testing. More...
 
static const std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::DIALOG_REQUEST_ID_TEST ("DialogRequestId_Test")
 DialogRequestId for testing. More...
 
static const std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::TOKEN_TEST ("Token_Test")
 Token for testing. More...
 
static const std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::FORMAT_TEST ("AUDIO_MPEG")
 Format of the audio. More...
 
static const std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::URL_TEST ("cid:Test")
 URL for testing. More...
 
static const std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::CONTEXT_ID_TEST ("ContextId_Test")
 Context ID for testing. More...
 
static const std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::CONTEXT_ID_TEST_2 ("ContextId_Test_2")
 Context ID for testing. More...
 
static const std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::FINISHED_STATE ("FINISHED")
 The FINISHED state of the SpeechSynthesizer. More...
 
static const std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::COMPONENT_NAME ("SpeechSynthesizer")
 Component name for power resource management. More...
 
static SpeakTestInfo alexaClientSDK::capabilityAgents::speechSynthesizer::test::generateSpeakInfo (PlayBehavior playBehavior)
 
static std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::generatePlayingState (const SpeakTestInfo &info)
 
static std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::generateFinishedState (const SpeakTestInfo &info)
 
static std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::generateInterruptedState (const SpeakTestInfo &info)
 
static bool alexaClientSDK::capabilityAgents::speechSynthesizer::test::matchEvent (std::shared_ptr< MessageRequest > request, const std::string &expectedContent)
 
 alexaClientSDK::capabilityAgents::speechSynthesizer::test::MATCHER (IsStartedEvent, "")
 
 alexaClientSDK::capabilityAgents::speechSynthesizer::test::MATCHER (IsFinishedEvent, "")
 
 alexaClientSDK::capabilityAgents::speechSynthesizer::test::MATCHER (IsInterruptedEvent, "")
 
 alexaClientSDK::capabilityAgents::speechSynthesizer::test::TEST_F (SpeechSynthesizerTest, test_createWithNullAudioPipelineFactoryFails)
 
 alexaClientSDK::capabilityAgents::speechSynthesizer::test::TEST_F (SpeechSynthesizerTest, test_callingHandleImmediately)
 
 alexaClientSDK::capabilityAgents::speechSynthesizer::test::TEST_F (SpeechSynthesizerTest, test_callingHandle)
 
 alexaClientSDK::capabilityAgents::speechSynthesizer::test::TEST_F (SpeechSynthesizerTest, test_callingCancel)
 
 alexaClientSDK::capabilityAgents::speechSynthesizer::test::TEST_F (SpeechSynthesizerTest, test_callingCancelAfterHandle)
 
 alexaClientSDK::capabilityAgents::speechSynthesizer::test::TEST_F (SpeechSynthesizerTest, test_callingProvideStateWhenNotPlaying)
 
 alexaClientSDK::capabilityAgents::speechSynthesizer::test::TEST_F (SpeechSynthesizerTest, test_callingProvideStateWhenPlaying)
 
 alexaClientSDK::capabilityAgents::speechSynthesizer::test::TEST_F (SpeechSynthesizerTest, testTimer_bargeInWhilePlaying)
 
 alexaClientSDK::capabilityAgents::speechSynthesizer::test::TEST_F (SpeechSynthesizerTest, testTimer_notCallStopTwice)
 
 alexaClientSDK::capabilityAgents::speechSynthesizer::test::TEST_F (SpeechSynthesizerTest, testSlow_callingCancelBeforeOnFocusChanged)
 
 alexaClientSDK::capabilityAgents::speechSynthesizer::test::TEST_F (SpeechSynthesizerTest, test_callingCancelBeforeOnExecuteStateChanged)
 
 alexaClientSDK::capabilityAgents::speechSynthesizer::test::TEST_F (SpeechSynthesizerTest, test_mediaPlayerFailedToStop)
 
 alexaClientSDK::capabilityAgents::speechSynthesizer::test::TEST_F (SpeechSynthesizerTest, testTimer_mediaPlayerAlwaysFailToStop)
 
 alexaClientSDK::capabilityAgents::speechSynthesizer::test::TEST_F (SpeechSynthesizerTest, testSlow_setStateTimeout)
 
 alexaClientSDK::capabilityAgents::speechSynthesizer::test::TEST_F (SpeechSynthesizerTest, test_givenPlayingStateFocusBecomesNone)
 
 alexaClientSDK::capabilityAgents::speechSynthesizer::test::TEST_F (SpeechSynthesizerTest, testTimer_onPlayedStopped)
 
 alexaClientSDK::capabilityAgents::speechSynthesizer::test::TEST_F (SpeechSynthesizerTest, test_replaceAllWithEmptyQueue)
 
 alexaClientSDK::capabilityAgents::speechSynthesizer::test::TEST_F (SpeechSynthesizerTest, test_replaceAllWithNonEmptyQueue)
 
 alexaClientSDK::capabilityAgents::speechSynthesizer::test::TEST_F (SpeechSynthesizerTest, test_replaceAllStopActiveSpeech)
 
 alexaClientSDK::capabilityAgents::speechSynthesizer::test::TEST_F (SpeechSynthesizerTest, test_enqueueWithActiveSpeech)
 
 alexaClientSDK::capabilityAgents::speechSynthesizer::test::TEST_F (SpeechSynthesizerTest, test_replaceEnqueuedWithAnotherEnqueuedItem)
 
 alexaClientSDK::capabilityAgents::speechSynthesizer::test::TEST_F (SpeechSynthesizerTest, test_parsingSingleAnalyzerConfig)
 
 alexaClientSDK::capabilityAgents::speechSynthesizer::test::TEST_F (SpeechSynthesizerTest, test_parsingMultipleAnalyzerConfig)
 
 alexaClientSDK::capabilityAgents::speechSynthesizer::test::TEST_F (SpeechSynthesizerTest, test_handleDirectiveWithEmptyAttachment)
 

Variables

static const MediaPlayerState alexaClientSDK::capabilityAgents::speechSynthesizer::test::DEFAULT_MEDIA_PLAYER_STATE = {std::chrono::milliseconds(0)}
 Default media player state for all playback events. More...
 
static std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::SPEECH_STARTED_EVENT_NAME {"SpeechStarted"}
 The name of the event to send to the AVS server once audio starting playing. More...
 
static std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::SPEECH_FINISHED_EVENT_NAME {"SpeechFinished"}
 The name of the event to send to the AVS server once audio finishes playing. More...
 
static std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::SPEECH_INTERRUPTED_EVENT_NAME {"SpeechInterrupted"}
 The name of the event to send to the AVS server once audio playing has been interrupted. More...
 
static const NamespaceAndName alexaClientSDK::capabilityAgents::speechSynthesizer::test::NAMESPACE_AND_NAME_SPEECH_STATE {NAMESPACE_SPEECH_SYNTHESIZER, "SpeechState"}
 The NamespaceAndName to send to the ContextManager. More...
 
static const std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::CAPTION_CONTENT_SAMPLE
 
static const std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::PAYLOAD_TEST
 A payload for testing. More...
 
static const std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::PAYLOAD_TEST_SINGLE_ANALYZER
 A payload for testing with single audio analyzer entry. More...
 
static const std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::PAYLOAD_TEST_MULTIPLE_ANALYZER
 A payload for testing with multiple audio analyzer entry. More...
 
static const std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::UNPARSED_DIRECTIVE_TEST
 A complete unparsed JSON directive for creating a directive without an attachment manager. More...
 
static const std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::PLAYING_STATE {"PLAYING"}
 The PLAYING state of the SpeechSynthesizer. More...
 
static const std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::INTERRUPTED_STATE {"INTERRUPTED"}
 The INTERRUPTED state of the SpeechSynthesizer. More...
 
static const long alexaClientSDK::capabilityAgents::speechSynthesizer::test::OFFSET_IN_MILLISECONDS_TEST {100}
 The offset in milliseconds returned by the mock media player. More...
 
static const std::chrono::milliseconds alexaClientSDK::capabilityAgents::speechSynthesizer::test::OFFSET_IN_CHRONO_MILLISECONDS_TEST {100}
 An std::chrono::milliseconds representation of the offset. More...
 
static const std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::PLAYING_STATE_TEST
 The expected state when the SpeechSynthesizer is in PLAYING state. More...
 
static const std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::FINISHED_STATE_TEST
 The expected state when the SpeechSynthesizer is in FINISHED state. More...
 
static const std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::INTERRUPTED_STATE_TEST
 The expected state when the SpeechSynthesizer is in INTERRUPTED state. More...
 
static const std::string alexaClientSDK::capabilityAgents::speechSynthesizer::test::IDLE_STATE_TEST
 The expected state when the SpeechSynthesizer is not handling any directive. More...
 
static const unsigned int alexaClientSDK::capabilityAgents::speechSynthesizer::test::PROVIDE_STATE_TOKEN_TEST {1}
 Provide State Token for testing. More...
 

AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0