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

Classes

class  PresentationOrchestratorClientTest
 Test harness for PresentationOrchestratorClient class. More...
 

Functions

PresentationOptions generatePresentationOptions (const std::chrono::milliseconds &timeout, const PresentationLifespan &lifespan, const std::string &interfaceName, const std::string &metadata)
 
PresentationOrchestratorWindowInstance generateWindowInstance (const std::string &windowId, const int &zOrder, const std::vector< std::string > &supportedInterfaces)
 
 TEST_F (PresentationOrchestratorClientTest, testRequestWindowInvalidWindowId)
 
 TEST_F (PresentationOrchestratorClientTest, testRequestWindowUnsupportedInterface)
 
 TEST_F (PresentationOrchestratorClientTest, testAddAndRequestWindow)
 
 TEST_F (PresentationOrchestratorClientTest, testAddRequestAndRemoveWindowWithTimeouts)
 
 TEST_F (PresentationOrchestratorClientTest, testRequestTokens)
 
 TEST_F (PresentationOrchestratorClientTest, testOnPresentationAvailable)
 
 TEST_F (PresentationOrchestratorClientTest, testMetadataUpdate)
 
 TEST_F (PresentationOrchestratorClientTest, testRequestAndClearMultipleWindowsWithSameZOrderIndex)
 
 TEST_F (PresentationOrchestratorClientTest, testRequestAndClearMultipleWindowsWithDifferentZOrderIndex)
 
 TEST_F (PresentationOrchestratorClientTest, testNavigateBack)
 
 TEST_F (PresentationOrchestratorClientTest, testNavigateBackMultipleWindowsSingleLongPresentationEach)
 
 TEST_F (PresentationOrchestratorClientTest, testNavigateBackMultipleWindowsLongOnPermanent)
 
 TEST_F (PresentationOrchestratorClientTest, testNavigateBackMultipleWindowsPermanentOnLong)
 
 TEST_F (PresentationOrchestratorClientTest, testNavigateBackPermanent)
 
 TEST_F (PresentationOrchestratorClientTest, testNavigateBackPermanentOnLong)
 
 TEST_F (PresentationOrchestratorClientTest, testNavigateBackShortHandlesBack)
 
 TEST_F (PresentationOrchestratorClientTest, testRequestWindowTransientFollowedByLongPresentation)
 
 TEST_F (PresentationOrchestratorClientTest, testRequestWindowShortFollowedByLongPresentation)
 
 TEST_F (PresentationOrchestratorClientTest, testRequestWindowShortFollowedByTransientPresentation)
 
 TEST_F (PresentationOrchestratorClientTest, testRequestWindowLongFollowedByTransientPresentation)
 
 TEST_F (PresentationOrchestratorClientTest, testDismissShortOnPermanent)
 
 TEST_F (PresentationOrchestratorClientTest, testDismissTransientOnPermanent)
 
 TEST_F (PresentationOrchestratorClientTest, testDefaultingTimeout)
 
 TEST_F (PresentationOrchestratorClientTest, testPresentationDisabledTimeout)
 
 TEST_F (PresentationOrchestratorClientTest, testDisablingTimeoutUsingSetTimeout)
 
 TEST_F (PresentationOrchestratorClientTest, testPermanentPresentationCustomTimeout)
 
 TEST_F (PresentationOrchestratorClientTest, testPermanentPresentationUpdateToShortCustomTimeout)
 
 TEST_F (PresentationOrchestratorClientTest, testShortLifespanToLongLifespanChangeDisablesTimeout)
 

Variables

static const auto SHORT_DELAY = std::chrono::milliseconds(500)
 
static const char CLIENT_ID [] = "clientId"
 
static const char WINDOW_ID_1 [] = "windowId1"
 
static const char WINDOW_ID_2 [] = "windowId2"
 
static const char INTERFACE_1 [] = "interface1"
 
static const char INTERFACE_2 [] = "interface2"
 
static const char METADATA_1 [] = "metadata1"
 
static const char METADATA_2 [] = "metadata2"
 
static const auto TIMEOUT = std::chrono::milliseconds(500)
 
static const std::chrono::milliseconds DEFAULT_TIMEOUT_SHORT_PRESENTATION_MS {30000}
 Default timeout for SHORT presentations. More...
 

Function Documentation

◆ generatePresentationOptions()

PresentationOptions alexaClientSDK::presentationOrchestratorClient::test::generatePresentationOptions ( const std::chrono::milliseconds &  timeout,
const PresentationLifespan lifespan,
const std::string &  interfaceName,
const std::string &  metadata 
)

◆ generateWindowInstance()

PresentationOrchestratorWindowInstance alexaClientSDK::presentationOrchestratorClient::test::generateWindowInstance ( const std::string &  windowId,
const int &  zOrder,
const std::vector< std::string > &  supportedInterfaces 
)

◆ TEST_F() [1/28]

alexaClientSDK::presentationOrchestratorClient::test::TEST_F ( PresentationOrchestratorClientTest  ,
testRequestWindowInvalidWindowId   
)

Tests requestWindow for a windowId not recognized by PO Client

◆ TEST_F() [2/28]

alexaClientSDK::presentationOrchestratorClient::test::TEST_F ( PresentationOrchestratorClientTest  ,
testRequestWindowUnsupportedInterface   
)

Tests requestWindow for a presentation with an interface not supported by requested window

◆ TEST_F() [3/28]

alexaClientSDK::presentationOrchestratorClient::test::TEST_F ( PresentationOrchestratorClientTest  ,
testAddAndRequestWindow   
)

Tests whether acquireWindow of state tracker is called with the correct params post requestWindow

◆ TEST_F() [4/28]

alexaClientSDK::presentationOrchestratorClient::test::TEST_F ( PresentationOrchestratorClientTest  ,
testAddRequestAndRemoveWindowWithTimeouts   
)

Tests whether timeout is requested on requestedWindow and stopped on window removal

◆ TEST_F() [5/28]

alexaClientSDK::presentationOrchestratorClient::test::TEST_F ( PresentationOrchestratorClientTest  ,
testRequestTokens   
)

Tests whether presentation request tokens are returned without awaiting for executor tasks to be completed

◆ TEST_F() [6/28]

alexaClientSDK::presentationOrchestratorClient::test::TEST_F ( PresentationOrchestratorClientTest  ,
testOnPresentationAvailable   
)

Tests presentation observer is notified of availability post requestWindow

◆ TEST_F() [7/28]

alexaClientSDK::presentationOrchestratorClient::test::TEST_F ( PresentationOrchestratorClientTest  ,
testMetadataUpdate   
)

Tests updatePresentationMetadata of state tracker is invoked with correct params Window was requested previously and should be in foreground focused state before another requestWindow call

◆ TEST_F() [8/28]

alexaClientSDK::presentationOrchestratorClient::test::TEST_F ( PresentationOrchestratorClientTest  ,
testRequestAndClearMultipleWindowsWithSameZOrderIndex   
)

Tests state of presentations from two windows having same zOrderIndex on requestWindow and clearPresentations

◆ TEST_F() [9/28]

alexaClientSDK::presentationOrchestratorClient::test::TEST_F ( PresentationOrchestratorClientTest  ,
testRequestAndClearMultipleWindowsWithDifferentZOrderIndex   
)

Tests state of presentations from two windows having different zOrderIndex on requestWindow and clearPresentations The second requested window has a lower zOrderIndex than the first window in this case

◆ TEST_F() [10/28]

alexaClientSDK::presentationOrchestratorClient::test::TEST_F ( PresentationOrchestratorClientTest  ,
testNavigateBack   
)

Tests back navigation on a window with two presentations When both presentations are dismissed, releaseWindow of state tracker should be invoked

◆ TEST_F() [11/28]

alexaClientSDK::presentationOrchestratorClient::test::TEST_F ( PresentationOrchestratorClientTest  ,
testNavigateBackMultipleWindowsSingleLongPresentationEach   
)

Tests back navigation with two windows, each with one presentation (with LONG lifespans). When the topmost presentation is dismissed, the window should be released and the topmost presentation of the next window (if one exists) should then be foregrounded.

◆ TEST_F() [12/28]

alexaClientSDK::presentationOrchestratorClient::test::TEST_F ( PresentationOrchestratorClientTest  ,
testNavigateBackMultipleWindowsLongOnPermanent   
)

Tests back navigation with two windows each having a presentation with a different lifespan. When the topmost presentation (with LONG lifespan) is dismissed, the window should be released and the PERMANENT presentation of the next window should then be foregrounded. navigateBack() on the PERMANENT presentation should not release the window or cause a state change.

◆ TEST_F() [13/28]

alexaClientSDK::presentationOrchestratorClient::test::TEST_F ( PresentationOrchestratorClientTest  ,
testNavigateBackMultipleWindowsPermanentOnLong   
)

Tests back navigation with two windows each having a presentation with a different lifespan. When navigateBack() on the topmost presentation (with PERMANENT lifespan) is invoked, there should be no state change.

◆ TEST_F() [14/28]

alexaClientSDK::presentationOrchestratorClient::test::TEST_F ( PresentationOrchestratorClientTest  ,
testNavigateBackPermanent   
)

Tests back navigation on a single window having a presentation with PERMANENT lifespan Window shouldn't be released in this case

◆ TEST_F() [15/28]

alexaClientSDK::presentationOrchestratorClient::test::TEST_F ( PresentationOrchestratorClientTest  ,
testNavigateBackPermanentOnLong   
)

Tests back navigation on a window with two presentations Top PERMANENT presentation should not be dismissed on navigate back

◆ TEST_F() [16/28]

alexaClientSDK::presentationOrchestratorClient::test::TEST_F ( PresentationOrchestratorClientTest  ,
testNavigateBackShortHandlesBack   
)

Tests back navigation on a single window having a presentation with SHORT lifespan that handles back navigation Window shouldn't be released in this case

◆ TEST_F() [17/28]

alexaClientSDK::presentationOrchestratorClient::test::TEST_F ( PresentationOrchestratorClientTest  ,
testRequestWindowTransientFollowedByLongPresentation   
)

Test LONG presentation being foregrounded after TRANSIENT presentation in same window

◆ TEST_F() [18/28]

alexaClientSDK::presentationOrchestratorClient::test::TEST_F ( PresentationOrchestratorClientTest  ,
testRequestWindowShortFollowedByLongPresentation   
)

Test LONG presentation being foregrounded after SHORT presentation in same window

◆ TEST_F() [19/28]

alexaClientSDK::presentationOrchestratorClient::test::TEST_F ( PresentationOrchestratorClientTest  ,
testRequestWindowShortFollowedByTransientPresentation   
)

Test TRANSIENT presentation being foregrounded after SHORT presentation in same window

◆ TEST_F() [20/28]

alexaClientSDK::presentationOrchestratorClient::test::TEST_F ( PresentationOrchestratorClientTest  ,
testRequestWindowLongFollowedByTransientPresentation   
)

Test TRANSIENT presentation being foregrounded after LONG presentation in same window

◆ TEST_F() [21/28]

alexaClientSDK::presentationOrchestratorClient::test::TEST_F ( PresentationOrchestratorClientTest  ,
testDismissShortOnPermanent   
)

Test PERMANENT presentation should be foregrounded after SHORT presentation is dismissed

◆ TEST_F() [22/28]

alexaClientSDK::presentationOrchestratorClient::test::TEST_F ( PresentationOrchestratorClientTest  ,
testDismissTransientOnPermanent   
)

Test PERMANENT presentation should be foregrounded after TRANSIENT presentation is dismissed

◆ TEST_F() [23/28]

alexaClientSDK::presentationOrchestratorClient::test::TEST_F ( PresentationOrchestratorClientTest  ,
testDefaultingTimeout   
)

Test defaulting presentation timeouts in single window

◆ TEST_F() [24/28]

alexaClientSDK::presentationOrchestratorClient::test::TEST_F ( PresentationOrchestratorClientTest  ,
testPresentationDisabledTimeout   
)

Test presentation initialization with timeout disabled

◆ TEST_F() [25/28]

alexaClientSDK::presentationOrchestratorClient::test::TEST_F ( PresentationOrchestratorClientTest  ,
testDisablingTimeoutUsingSetTimeout   
)

Test disabling timeout using Presentation::setTimeout

◆ TEST_F() [26/28]

alexaClientSDK::presentationOrchestratorClient::test::TEST_F ( PresentationOrchestratorClientTest  ,
testPermanentPresentationCustomTimeout   
)

Test that custom timeout is not used for presentation with lifespan PERMANENT. VisualTimeoutManager requestTimeout should not be called.

◆ TEST_F() [27/28]

alexaClientSDK::presentationOrchestratorClient::test::TEST_F ( PresentationOrchestratorClientTest  ,
testPermanentPresentationUpdateToShortCustomTimeout   
)

Test that custom timeout is not used for presentation with lifespan PERMANENT. However, once the lifespan is changed to SHORT, it uses the custom timeout instead of default.

◆ TEST_F() [28/28]

alexaClientSDK::presentationOrchestratorClient::test::TEST_F ( PresentationOrchestratorClientTest  ,
testShortLifespanToLongLifespanChangeDisablesTimeout   
)

Test timeout is stopped if the updated lifespan has a timeout disabled by default. Presentations with lifespan LONG have timeout disabled by default. This test changes lifespan from SHORT to LONG.

Variable Documentation

◆ CLIENT_ID

const char alexaClientSDK::presentationOrchestratorClient::test::CLIENT_ID[] = "clientId"
static

◆ DEFAULT_TIMEOUT_SHORT_PRESENTATION_MS

const std::chrono::milliseconds alexaClientSDK::presentationOrchestratorClient::test::DEFAULT_TIMEOUT_SHORT_PRESENTATION_MS {30000}
static

Default timeout for SHORT presentations.

◆ INTERFACE_1

const char alexaClientSDK::presentationOrchestratorClient::test::INTERFACE_1[] = "interface1"
static

◆ INTERFACE_2

const char alexaClientSDK::presentationOrchestratorClient::test::INTERFACE_2[] = "interface2"
static

◆ METADATA_1

const char alexaClientSDK::presentationOrchestratorClient::test::METADATA_1[] = "metadata1"
static

◆ METADATA_2

const char alexaClientSDK::presentationOrchestratorClient::test::METADATA_2[] = "metadata2"
static

◆ SHORT_DELAY

const auto alexaClientSDK::presentationOrchestratorClient::test::SHORT_DELAY = std::chrono::milliseconds(500)
static

◆ TIMEOUT

const auto alexaClientSDK::presentationOrchestratorClient::test::TIMEOUT = std::chrono::milliseconds(500)
static

◆ WINDOW_ID_1

const char alexaClientSDK::presentationOrchestratorClient::test::WINDOW_ID_1[] = "windowId1"
static

◆ WINDOW_ID_2

const char alexaClientSDK::presentationOrchestratorClient::test::WINDOW_ID_2[] = "windowId2"
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