AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Classes | Typedefs | Functions | Variables
alexaClientSDK::acsdkAlerts::renderer::test Namespace Reference

Classes

class  MockRendererObserver
 
class  RendererTest
 
class  TestMediaPlayer
 

Typedefs

using MediaPlayerState = avsCommon::utils::mediaPlayer::MediaPlayerState
 

Functions

 TEST_F (RendererTest, test_createAlertRenderer)
 
 TEST_F (RendererTest, test_create)
 
 TEST_F (RendererTest, test_start)
 
 TEST_F (RendererTest, test_stop)
 
 TEST_F (RendererTest, test_restart)
 
 TEST_F (RendererTest, test_stopError)
 
 TEST_F (RendererTest, test_onPlaybackStarted)
 
 TEST_F (RendererTest, test_onPlaybackStopped)
 
 TEST_F (RendererTest, test_onPlaybackFinishedError)
 
 TEST_F (RendererTest, test_onPlaybackError)
 
 TEST_F (RendererTest, testTimer_emptyURLNonZeroLoopPause)
 
 TEST_F (RendererTest, test_alarmVolumeRampRendering)
 

Variables

static const std::chrono::milliseconds TEST_TIMEOUT {100}
 Amount of time that the renderer observer should wait for a task to finish. More...
 
static const MediaPlayerState DEFAULT_MEDIA_PLAYER_STATE = {std::chrono::milliseconds(0)}
 Default media player state to report for all playback events. More...
 
static const avsCommon::utils::mediaPlayer::MediaPlayerInterface::SourceId TEST_SOURCE_ID_GOOD = 1234
 Test source Id that exists for the tests. More...
 
static const avsCommon::utils::mediaPlayer::MediaPlayerInterface::SourceId TEST_SOURCE_ID_BAD = 5678
 Test source Id that does not exist for the tests. More...
 
static const std::string TEST_URL1 = "fake.url.one"
 Test URLs for the renderer. More...
 
static const std::string TEST_URL2 = "fake.url.two"
 
static const std::chrono::milliseconds TEST_LOOP_PAUSE {100}
 Loop pause for the renderer. More...
 
static const int TEST_LOOP_COUNT = 2
 Loop count for the renderer. More...
 
static const auto TEST_BACKGROUND_LOOP_PAUSE = std::chrono::seconds(1)
 Loop background pause for the renderer. More...
 
static const auto TEST_BACKGROUND_TIMEOUT = std::chrono::seconds(5)
 Amount of time that the renderer observer should wait for a task to finish. More...
 
static const std::string ALARM_NAME = "ALARM"
 

Typedef Documentation

◆ MediaPlayerState

Function Documentation

◆ TEST_F() [1/12]

alexaClientSDK::acsdkAlerts::renderer::test::TEST_F ( RendererTest  ,
test_createAlertRenderer   
)

Test if the Renderer class creates an object appropriately and fails when it must

m_renderer was created using create() in the constructor. Check if not null

confirm we return a nullptr if a nullptr was passed in

◆ TEST_F() [2/12]

alexaClientSDK::acsdkAlerts::renderer::test::TEST_F ( RendererTest  ,
test_create   
)

Test if the Renderer class creates an object appropriately and fails when it must

confirm we return a nullptr if a nullptr was passed in

◆ TEST_F() [3/12]

alexaClientSDK::acsdkAlerts::renderer::test::TEST_F ( RendererTest  ,
test_start   
)

Test if the Renderer starts

◆ TEST_F() [4/12]

alexaClientSDK::acsdkAlerts::renderer::test::TEST_F ( RendererTest  ,
test_stop   
)

Test if the Renderer stops

◆ TEST_F() [5/12]

alexaClientSDK::acsdkAlerts::renderer::test::TEST_F ( RendererTest  ,
test_restart   
)

Test if the Renderer stops then restarts successfully

◆ TEST_F() [6/12]

alexaClientSDK::acsdkAlerts::renderer::test::TEST_F ( RendererTest  ,
test_stopError   
)

Test if the Renderer errors out when it cant stop

if stop fails, we should receive a PlaybackError from mediaplayer

◆ TEST_F() [7/12]

alexaClientSDK::acsdkAlerts::renderer::test::TEST_F ( RendererTest  ,
test_onPlaybackStarted   
)

Test if the Renderer correctly handles Playback starting

shouldn't start if the source is bad

should start if the source is good

◆ TEST_F() [8/12]

alexaClientSDK::acsdkAlerts::renderer::test::TEST_F ( RendererTest  ,
test_onPlaybackStopped   
)

Test if the Renderer correctly handles Playback stopping

shouldn't stop if the source is bad

should stop if the source is good

◆ TEST_F() [9/12]

alexaClientSDK::acsdkAlerts::renderer::test::TEST_F ( RendererTest  ,
test_onPlaybackFinishedError   
)

Test if the Renderer gracefully handles errors when Playback finishing

shouldn't finish even if the source is good, if the media player is errored out

shouldn't finish even if the source is good, if the media player can't play it

◆ TEST_F() [10/12]

alexaClientSDK::acsdkAlerts::renderer::test::TEST_F ( RendererTest  ,
test_onPlaybackError   
)

Test if the Renderer correctly handles Playback erroring out

shouldn't respond with errors if the source is bad

shouldn't respond with errors if the source is good

◆ TEST_F() [11/12]

alexaClientSDK::acsdkAlerts::renderer::test::TEST_F ( RendererTest  ,
testTimer_emptyURLNonZeroLoopPause   
)

Test empty URL with non-zero loop pause, simulating playing a default alarm audio on background

◆ TEST_F() [12/12]

alexaClientSDK::acsdkAlerts::renderer::test::TEST_F ( RendererTest  ,
test_alarmVolumeRampRendering   
)

Test alarmVolumeRampRendering.

Variable Documentation

◆ ALARM_NAME

const std::string alexaClientSDK::acsdkAlerts::renderer::test::ALARM_NAME = "ALARM"
static

◆ DEFAULT_MEDIA_PLAYER_STATE

const MediaPlayerState alexaClientSDK::acsdkAlerts::renderer::test::DEFAULT_MEDIA_PLAYER_STATE = {std::chrono::milliseconds(0)}
static

Default media player state to report for all playback events.

◆ TEST_BACKGROUND_LOOP_PAUSE

const auto alexaClientSDK::acsdkAlerts::renderer::test::TEST_BACKGROUND_LOOP_PAUSE = std::chrono::seconds(1)
static

Loop background pause for the renderer.

◆ TEST_BACKGROUND_TIMEOUT

const auto alexaClientSDK::acsdkAlerts::renderer::test::TEST_BACKGROUND_TIMEOUT = std::chrono::seconds(5)
static

Amount of time that the renderer observer should wait for a task to finish.

◆ TEST_LOOP_COUNT

const int alexaClientSDK::acsdkAlerts::renderer::test::TEST_LOOP_COUNT = 2
static

Loop count for the renderer.

◆ TEST_LOOP_PAUSE

const std::chrono::milliseconds alexaClientSDK::acsdkAlerts::renderer::test::TEST_LOOP_PAUSE {100}
static

Loop pause for the renderer.

◆ TEST_SOURCE_ID_BAD

const avsCommon::utils::mediaPlayer::MediaPlayerInterface::SourceId alexaClientSDK::acsdkAlerts::renderer::test::TEST_SOURCE_ID_BAD = 5678
static

Test source Id that does not exist for the tests.

◆ TEST_SOURCE_ID_GOOD

const avsCommon::utils::mediaPlayer::MediaPlayerInterface::SourceId alexaClientSDK::acsdkAlerts::renderer::test::TEST_SOURCE_ID_GOOD = 1234
static

Test source Id that exists for the tests.

◆ TEST_TIMEOUT

const std::chrono::milliseconds alexaClientSDK::acsdkAlerts::renderer::test::TEST_TIMEOUT {100}
static

Amount of time that the renderer observer should wait for a task to finish.

◆ TEST_URL1

const std::string alexaClientSDK::acsdkAlerts::renderer::test::TEST_URL1 = "fake.url.one"
static

Test URLs for the renderer.

◆ TEST_URL2

const std::string alexaClientSDK::acsdkAlerts::renderer::test::TEST_URL2 = "fake.url.two"
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