AlexaClientSDK
3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
|
Classes | |
class | MediaPlayerTest |
class | MockAttachmentReader |
class | MockContentFetcher |
A mock content fetcher. More... | |
class | MockContentFetcherFactory |
A mock factory that creates mock content fetchers. More... | |
class | MockPlayerObserver |
class | NormalizerTest |
class | PooledMediaPlayerFactoryTest |
class | TestFactoryObserver |
Functions | |
TEST_F (PooledMediaPlayerFactoryTest, test_acquirePlayers) | |
TEST_F (PooledMediaPlayerFactoryTest, test_releasePlayers) | |
TEST_F (PooledMediaPlayerFactoryTest, test_recyclePlayers) | |
TEST_F (PooledMediaPlayerFactoryTest, test_onReadyCallback) | |
TEST_F (PooledMediaPlayerFactoryTest, test_isMediaPlayerAvailable) | |
TEST (ErrorTypeConversionTest, test_errorTypeToString) | |
TEST (ErrorTypeConversionTest, test_gstCoreErrorToErrorType) | |
TEST (ErrorTypeConversionTest, test_gstLibraryErrorToErrorType) | |
TEST (ErrorTypeConversionTest, test_gstResourceErrorToErrorType) | |
TEST (ErrorTypeConversionTest, test_gstStreamErrorToErrorType) | |
static const std::string | MP3_FILE_PATH ("/fox_dog.mp3") |
MP3 test file path. More... | |
static const std::string | TEST_M3U_PLAYLIST_URL ("fox_dog_playlist.m3u") |
static const std::string | FILE_PREFIX ("file://") |
file URI Prefix More... | |
static const std::chrono::milliseconds | MP3_FILE_LENGTH (2688) |
File length for the MP3 test file. More... | |
static const std::chrono::milliseconds | OFFSET (2000) |
Offset to start playback at. More... | |
static const std::chrono::milliseconds | TOLERANCE (500) |
Tolerance when setting expectations. More... | |
static const std::chrono::milliseconds | PADDING (10) |
Padding to add to offsets when necessary. More... | |
INSTANTIATE_TEST_CASE_P (Parameterized, MediaPlayerTest, ::testing::Bool()) | |
TEST_P (MediaPlayerTest, testSlow_startPlayWaitForEnd) | |
TEST_P (MediaPlayerTest, testSlow_startPlayForUrl) | |
TEST_P (MediaPlayerTest, testSlow_consecutiveSetSource) | |
TEST_P (MediaPlayerTest, testSlow_startPlayWaitForEndStartPlayAgain) | |
TEST_P (MediaPlayerTest, testSlow_stopPlay) | |
TEST_P (MediaPlayerTest, testSlow_startPlayCallAfterStopPlay) | |
TEST_P (MediaPlayerTest, testSlow_startPlayCallAfterStopPlayDifferentSource) | |
TEST_P (MediaPlayerTest, testSlow_pauseDuringPlay) | |
TEST_P (MediaPlayerTest, testSlow_resumeAfterPauseThenStop) | |
TEST_P (MediaPlayerTest, testSlow_stopAfterPause) | |
TEST_P (MediaPlayerTest, testSlow_pauseAfterPause) | |
TEST_P (MediaPlayerTest, test_resumeAfterPlay) | |
TEST_P (MediaPlayerTest, testTimer_getOffsetInMilliseconds) | |
TEST_P (MediaPlayerTest, test_getOffsetInMillisecondsNullPipeline) | |
TEST_P (MediaPlayerTest, testSlow_getOffsetWhenStoppedFails) | |
Tests that calls to getOffset fail when the pipeline is in a stopped state. More... | |
TEST_P (MediaPlayerTest, testSlow_getOffsetWhenPaused) | |
Tests that calls to getOffset succeed when the pipeline is in a paused state. More... | |
TEST_P (MediaPlayerTest, testSlow_playingTwoAttachments) | |
TEST_P (MediaPlayerTest, DISABLED_testSlow_unsteadyReads) | |
TEST_P (MediaPlayerTest, DISABLED_testSlow_recoveryFromPausedReads) | |
TEST_P (MediaPlayerTest, testSlow_startPlayWithUrlPlaylistWaitForEnd) | |
Tests playing a dummy playlist. More... | |
TEST_P (MediaPlayerTest, testTimer_setOffsetSeekableSource) | |
TEST_P (MediaPlayerTest, DISABLED_test_setOffsetOutsideBounds) | |
TEST_P (MediaPlayerTest, DISABLED_test_setSourceResetsOffset) | |
TEST_P (MediaPlayerTest, testSlow_repeatAttachment) | |
TEST_P (MediaPlayerTest, testSlow_setVolumePlays) | |
TEST_P (MediaPlayerTest, testSlow_setMutePlays) | |
TEST_P (MediaPlayerTest, test_getSpeakerSettings) | |
TEST_P (MediaPlayerTest, testSlow_readTags) | |
TEST_P (MediaPlayerTest, test_consecutiveSameApiCalls) | |
Tests that consecutive calls to the same public API fails. More... | |
TEST_P (MediaPlayerTest, testSlow_immediatePause) | |
Tests that pausing immediately before waiting for a callback is valid. More... | |
TEST_P (MediaPlayerTest, testSlow_multiplePlayAndSetSource) | |
Tests setting multiple set source calls and observing onPlaybackStopped and onPlaybackFinished calls. More... | |
TEST_P (MediaPlayerTest, test_invalidSourceId) | |
Tests passing an invalid source id to a play() call. More... | |
TEST_P (MediaPlayerTest, test_doublePause) | |
Tests that two consecutive calls to pause fails. More... | |
TEST_P (MediaPlayerTest, test_resumeWhenPlaying) | |
Tests that a resume when already playing fails. More... | |
TEST_P (MediaPlayerTest, test_resumeWhenStopped) | |
Tests that a resume when stopped (not paused) fails. More... | |
TEST_P (MediaPlayerTest, test_newSetSourceLeadsToStoppedCallback) | |
Tests that a stop callback when playing leads to an onPlaybackStopped callback. More... | |
TEST_P (MediaPlayerTest, testSlow_resumeAfterPauseWithPendingPlay) | |
Tests that resuming after a pause with a pending play leads to an onPlaybackResumed callback. More... | |
TEST_P (MediaPlayerTest, testSlow_PlayWithFadeIn) | |
TEST_P (MediaPlayerTest, testSlow_PlayWithFadeInMidVolume) | |
TEST_P (MediaPlayerTest, testSlow_PlayWithFadeInOutOfLimit) | |
TEST_P (MediaPlayerTest, testSlow_PlayWithFadeInStartGreater) | |
TEST_P (MediaPlayerTest, testSlow_repeatPlayForUrl) | |
Tests that playing continues until stop is called when repeat is on. More... | |
TEST_F (NormalizerTest, test_normalizeNullResult) | |
TEST_F (NormalizerTest, test_createSourceMinGreaterThanMax) | |
TEST_F (NormalizerTest, test_createSourceMinEqualToMax) | |
TEST_F (NormalizerTest, test_createNormalizeMinGreaterThanMax) | |
TEST_F (NormalizerTest, test_normalizeNormalizedMinEqualToMax) | |
TEST_F (NormalizerTest, test_normalizeInputOutsideSourceBounds) | |
TEST_F (NormalizerTest, test_normalizeSameScale) | |
TEST_F (NormalizerTest, test_normalizeScaleDown) | |
TEST_F (NormalizerTest, test_normalizeScaleUp) | |
TEST_F (NormalizerTest, test_normalizeNegativeRange) | |
TEST_F (NormalizerTest, test_normalizeDifferentMinimums) | |
TEST_F (NormalizerTest, test_nonInteger) | |
Variables | |
static const MediaPlayer::SourceId | ERROR_SOURCE_ID = MediaPlayer::ERROR |
std::string | inputsDirPath |
The path to the input Dir containing the test audio files. More... | |
static std::string | TEST_M3U_PLAYLIST_CONTENT |
static const alexaClientSDK::avsCommon::utils::MediaType | MP3_TYPE = alexaClientSDK::avsCommon::utils::MediaType::MPEG |
static std::unordered_map< std::string, std::string > | urlsToContentTypes |
static std::unordered_map< std::string, std::string > | urlsToContent |
|
static |
file URI Prefix
alexaClientSDK::mediaPlayer::test::INSTANTIATE_TEST_CASE_P | ( | Parameterized | , |
MediaPlayerTest | , | ||
::testing::Bool() | |||
) |
|
static |
File length for the MP3 test file.
|
static |
MP3 test file path.
|
static |
Offset to start playback at.
|
static |
Padding to add to offsets when necessary.
alexaClientSDK::mediaPlayer::test::TEST | ( | ErrorTypeConversionTest | , |
test_errorTypeToString | |||
) |
Test to verify that the ErrorTypes convert to the error strings properly.
alexaClientSDK::mediaPlayer::test::TEST | ( | ErrorTypeConversionTest | , |
test_gstCoreErrorToErrorType | |||
) |
Test to verify that the correct GErrors convert to the proper ErrorType.
alexaClientSDK::mediaPlayer::test::TEST | ( | ErrorTypeConversionTest | , |
test_gstLibraryErrorToErrorType | |||
) |
Test to verify that the correct Library GErrors convert to the proper ErrorType.
alexaClientSDK::mediaPlayer::test::TEST | ( | ErrorTypeConversionTest | , |
test_gstResourceErrorToErrorType | |||
) |
Test to verify that the correct Resource GErrors convert to the proper ErrorType.
alexaClientSDK::mediaPlayer::test::TEST | ( | ErrorTypeConversionTest | , |
test_gstStreamErrorToErrorType | |||
) |
Test to verify that the correct Stream GErrors convert to the proper ErrorType.
alexaClientSDK::mediaPlayer::test::TEST_F | ( | NormalizerTest | , |
test_normalizeNullResult | |||
) |
Test normalize with a nullptr.
alexaClientSDK::mediaPlayer::test::TEST_F | ( | NormalizerTest | , |
test_createSourceMinGreaterThanMax | |||
) |
Test create with a source min larger than source max.
alexaClientSDK::mediaPlayer::test::TEST_F | ( | NormalizerTest | , |
test_createSourceMinEqualToMax | |||
) |
Test create with a source min equal to source max.
alexaClientSDK::mediaPlayer::test::TEST_F | ( | NormalizerTest | , |
test_createNormalizeMinGreaterThanMax | |||
) |
Test create with a normalized min larger than normalized max.
alexaClientSDK::mediaPlayer::test::TEST_F | ( | NormalizerTest | , |
test_normalizeNormalizedMinEqualToMax | |||
) |
Test normalize with a normalized min equal to normalized max.
alexaClientSDK::mediaPlayer::test::TEST_F | ( | NormalizerTest | , |
test_normalizeInputOutsideSourceBounds | |||
) |
Test normalize with an input outside the source bounds.
alexaClientSDK::mediaPlayer::test::TEST_F | ( | NormalizerTest | , |
test_normalizeSameScale | |||
) |
Test normalizing to the same range.
alexaClientSDK::mediaPlayer::test::TEST_F | ( | NormalizerTest | , |
test_normalizeScaleDown | |||
) |
Test normalizing to a smaller range.
alexaClientSDK::mediaPlayer::test::TEST_F | ( | PooledMediaPlayerFactoryTest | , |
test_acquirePlayers | |||
) |
alexaClientSDK::mediaPlayer::test::TEST_F | ( | NormalizerTest | , |
test_normalizeScaleUp | |||
) |
Test normalizing to a larger range.
alexaClientSDK::mediaPlayer::test::TEST_F | ( | PooledMediaPlayerFactoryTest | , |
test_releasePlayers | |||
) |
alexaClientSDK::mediaPlayer::test::TEST_F | ( | NormalizerTest | , |
test_normalizeNegativeRange | |||
) |
Test normalizing to a negative range.
alexaClientSDK::mediaPlayer::test::TEST_F | ( | NormalizerTest | , |
test_normalizeDifferentMinimums | |||
) |
Test where source min != normalize min.
alexaClientSDK::mediaPlayer::test::TEST_F | ( | PooledMediaPlayerFactoryTest | , |
test_recyclePlayers | |||
) |
alexaClientSDK::mediaPlayer::test::TEST_F | ( | NormalizerTest | , |
test_nonInteger | |||
) |
Test where result is a non-integer.
alexaClientSDK::mediaPlayer::test::TEST_F | ( | PooledMediaPlayerFactoryTest | , |
test_onReadyCallback | |||
) |
alexaClientSDK::mediaPlayer::test::TEST_F | ( | PooledMediaPlayerFactoryTest | , |
test_isMediaPlayerAvailable | |||
) |
|
static |
alexaClientSDK::mediaPlayer::test::TEST_P | ( | MediaPlayerTest | , |
testSlow_startPlayWaitForEnd | |||
) |
Read an audio file into a buffer. Set the source of the MediaPlayer
to the buffer. Playback audio till the end. Check whether the playback started and playback finished notifications are received.
alexaClientSDK::mediaPlayer::test::TEST_P | ( | MediaPlayerTest | , |
testSlow_startPlayForUrl | |||
) |
Set the source of the MediaPlayer
to a url representing a single audio file. Playback audio till the end. Check whether the playback started and playback finished notifications are received.
alexaClientSDK::mediaPlayer::test::TEST_P | ( | MediaPlayerTest | , |
testSlow_consecutiveSetSource | |||
) |
Set the source of the MediaPlayer
twice consecutively to a url representing a single audio file. Playback audio till the end. Check whether the playback started and playback finished notifications are received.
Consecutive calls to setSource(const std::string url) without play() cause tests to occasionally fail: ACSDK-508.
alexaClientSDK::mediaPlayer::test::TEST_P | ( | MediaPlayerTest | , |
testSlow_startPlayWaitForEndStartPlayAgain | |||
) |
Plays a second different type of source after one source has finished playing.
alexaClientSDK::mediaPlayer::test::TEST_P | ( | MediaPlayerTest | , |
testSlow_stopPlay | |||
) |
Read an audio file into a buffer. Set the source of the MediaPlayer
to the buffer. Playback audio for a few seconds. Playback started notification should be received when the playback starts. Then call stop
and expect the playback finished notification is received.
alexaClientSDK::mediaPlayer::test::TEST_P | ( | MediaPlayerTest | , |
testSlow_startPlayCallAfterStopPlay | |||
) |
Read an audio file into a buffer. Set the source of the MediaPlayer
to the buffer. Playback audio for a few seconds. Playback started notification should be received when the playback starts. Then call stop
and expect the playback finished notification is received.
alexaClientSDK::mediaPlayer::test::TEST_P | ( | MediaPlayerTest | , |
testSlow_startPlayCallAfterStopPlayDifferentSource | |||
) |
Read an audio file into a buffer. Set the source of the MediaPlayer
to the buffer. Playback audio for a few seconds. Playback started notification should be received when the playback starts. Call stop
. and wait for the playback finished notification is received. Call play
again.
alexaClientSDK::mediaPlayer::test::TEST_P | ( | MediaPlayerTest | , |
testSlow_pauseDuringPlay | |||
) |
alexaClientSDK::mediaPlayer::test::TEST_P | ( | MediaPlayerTest | , |
testSlow_resumeAfterPauseThenStop | |||
) |
alexaClientSDK::mediaPlayer::test::TEST_P | ( | MediaPlayerTest | , |
testSlow_stopAfterPause | |||
) |
alexaClientSDK::mediaPlayer::test::TEST_P | ( | MediaPlayerTest | , |
testSlow_pauseAfterPause | |||
) |
alexaClientSDK::mediaPlayer::test::TEST_P | ( | MediaPlayerTest | , |
test_resumeAfterPlay | |||
) |
alexaClientSDK::mediaPlayer::test::TEST_P | ( | MediaPlayerTest | , |
testTimer_getOffsetInMilliseconds | |||
) |
Read an audio file into a buffer. Set the source of the MediaPlayer
to the buffer. Playback audio for a few seconds. Playback started notification should be received when the playback starts. Call getOffset
. Check the offset value. Then call stop
and expect the playback finished notification is received. Call getOffset
again. Check the offset value.
alexaClientSDK::mediaPlayer::test::TEST_P | ( | MediaPlayerTest | , |
test_getOffsetInMillisecondsNullPipeline | |||
) |
Test getOffset with a null pipeline. Expect that MEDIA_PLAYER_INVALID_OFFSET is returned. This currently results in errors on shutdown. Will be fixed by ACSDK-446.
alexaClientSDK::mediaPlayer::test::TEST_P | ( | MediaPlayerTest | , |
testSlow_getOffsetWhenStoppedFails | |||
) |
Tests that calls to getOffset fail when the pipeline is in a stopped state.
alexaClientSDK::mediaPlayer::test::TEST_P | ( | MediaPlayerTest | , |
testSlow_getOffsetWhenPaused | |||
) |
Tests that calls to getOffset succeed when the pipeline is in a paused state.
alexaClientSDK::mediaPlayer::test::TEST_P | ( | MediaPlayerTest | , |
testSlow_playingTwoAttachments | |||
) |
Check playing two attachments back to back. Read an audio file into a buffer. Set the source of the MediaPlayer
to the buffer. Playback audio for a few seconds. Playback started notification should be received when the playback starts. Call getOffset
. Check the offset value. Wait for playback to finish and expect the playback finished notification is received. Repeat the above for a new source.
alexaClientSDK::mediaPlayer::test::TEST_P | ( | MediaPlayerTest | , |
DISABLED_testSlow_unsteadyReads | |||
) |
Check playback of an attachment that is received sporadically. Playback started notification should be received when the playback starts. Wait for playback to finish and expect the playback finished notification is received. To a human ear the playback of this test is expected to sound reasonably smooth.
alexaClientSDK::mediaPlayer::test::TEST_P | ( | MediaPlayerTest | , |
DISABLED_testSlow_recoveryFromPausedReads | |||
) |
Check playback of an attachment whose receipt is interrupted for about 3 seconds. Playback started notification should be received when the playback starts. Wait for playback to finish and expect the playback finished notification is received. To a human ear the playback of this test is expected to sound reasonably smooth initially, then be interrupted for a few seconds, and then continue fairly smoothly.
alexaClientSDK::mediaPlayer::test::TEST_P | ( | MediaPlayerTest | , |
testSlow_startPlayWithUrlPlaylistWaitForEnd | |||
) |
Tests playing a dummy playlist.
alexaClientSDK::mediaPlayer::test::TEST_P | ( | MediaPlayerTest | , |
testTimer_setOffsetSeekableSource | |||
) |
Test setting the offset to a seekable source. Setting the offset should succeed and playback should start from the offset.
alexaClientSDK::mediaPlayer::test::TEST_P | ( | MediaPlayerTest | , |
DISABLED_test_setOffsetOutsideBounds | |||
) |
Test setting the offset outside the bounds of the source. Playback will immediately end.
alexaClientSDK::mediaPlayer::test::TEST_P | ( | MediaPlayerTest | , |
DISABLED_test_setSourceResetsOffset | |||
) |
Test calling setSource resets the offset.
Consecutive calls to setSource(const std::string url) without play() cause tests to occasionally fail: ACSDK-508.
alexaClientSDK::mediaPlayer::test::TEST_P | ( | MediaPlayerTest | , |
testSlow_repeatAttachment | |||
) |
Test consecutive setSource() and play() calls. Expect the PlaybackStarted and PlaybackFinished will be received before the timeout.
alexaClientSDK::mediaPlayer::test::TEST_P | ( | MediaPlayerTest | , |
testSlow_setVolumePlays | |||
) |
Test that the media plays after a volume change.
alexaClientSDK::mediaPlayer::test::TEST_P | ( | MediaPlayerTest | , |
testSlow_setMutePlays | |||
) |
Test the media plays to completion even if it's muted.
alexaClientSDK::mediaPlayer::test::TEST_P | ( | MediaPlayerTest | , |
test_getSpeakerSettings | |||
) |
Test that the speaker settings can be retrieved.
alexaClientSDK::mediaPlayer::test::TEST_P | ( | MediaPlayerTest | , |
testSlow_readTags | |||
) |
Read an audio file into a buffer. Set the source of the MediaPlayer
to the buffer. Playback audio till the end. Check whether the playback started and playback finished notifications are received. Check whether the tags were read from the file.
alexaClientSDK::mediaPlayer::test::TEST_P | ( | MediaPlayerTest | , |
test_consecutiveSameApiCalls | |||
) |
Tests that consecutive calls to the same public API fails.
alexaClientSDK::mediaPlayer::test::TEST_P | ( | MediaPlayerTest | , |
testSlow_immediatePause | |||
) |
Tests that pausing immediately before waiting for a callback is valid.
alexaClientSDK::mediaPlayer::test::TEST_P | ( | MediaPlayerTest | , |
testSlow_multiplePlayAndSetSource | |||
) |
Tests setting multiple set source calls and observing onPlaybackStopped and onPlaybackFinished calls.
alexaClientSDK::mediaPlayer::test::TEST_P | ( | MediaPlayerTest | , |
test_invalidSourceId | |||
) |
Tests passing an invalid source id to a play() call.
alexaClientSDK::mediaPlayer::test::TEST_P | ( | MediaPlayerTest | , |
test_doublePause | |||
) |
Tests that two consecutive calls to pause fails.
alexaClientSDK::mediaPlayer::test::TEST_P | ( | MediaPlayerTest | , |
test_resumeWhenPlaying | |||
) |
Tests that a resume when already playing fails.
alexaClientSDK::mediaPlayer::test::TEST_P | ( | MediaPlayerTest | , |
test_resumeWhenStopped | |||
) |
Tests that a resume when stopped (not paused) fails.
alexaClientSDK::mediaPlayer::test::TEST_P | ( | MediaPlayerTest | , |
test_newSetSourceLeadsToStoppedCallback | |||
) |
Tests that a stop callback when playing leads to an onPlaybackStopped callback.
alexaClientSDK::mediaPlayer::test::TEST_P | ( | MediaPlayerTest | , |
testSlow_resumeAfterPauseWithPendingPlay | |||
) |
Tests that resuming after a pause with a pending play leads to an onPlaybackResumed callback.
alexaClientSDK::mediaPlayer::test::TEST_P | ( | MediaPlayerTest | , |
testSlow_PlayWithFadeIn | |||
) |
Test play with fade in.
alexaClientSDK::mediaPlayer::test::TEST_P | ( | MediaPlayerTest | , |
testSlow_PlayWithFadeInMidVolume | |||
) |
Test play with fade in.
alexaClientSDK::mediaPlayer::test::TEST_P | ( | MediaPlayerTest | , |
testSlow_PlayWithFadeInOutOfLimit | |||
) |
Test play with fade in that have out of limit values.
alexaClientSDK::mediaPlayer::test::TEST_P | ( | MediaPlayerTest | , |
testSlow_PlayWithFadeInStartGreater | |||
) |
Test play with fade in with start value greater than end value.
alexaClientSDK::mediaPlayer::test::TEST_P | ( | MediaPlayerTest | , |
testSlow_repeatPlayForUrl | |||
) |
Tests that playing continues until stop is called when repeat is on.
|
static |
Tolerance when setting expectations.
|
static |
std::string alexaClientSDK::mediaPlayer::test::inputsDirPath |
The path to the input Dir containing the test audio files.
|
static |
|
static |
|
static |
|
static |
AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0