AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Classes | Namespaces | Typedefs | Functions | Variables
FocusManagerTest.cpp File Reference
#include <memory>
#include <gtest/gtest.h>
#include <AVSCommon/AVS/FocusState.h>
#include <AVSCommon/SDKInterfaces/MockFocusManagerObserver.h>
#include <AVSCommon/Utils/Configuration/ConfigurationNode.h>
#include "AFML/FocusManager.h"
#include "InterruptModel/InterruptModel.h"
Include dependency graph for FocusManagerTest.cpp:

Classes

class  alexaClientSDK::afml::test::TestClient
 A test observer that mocks out the ChannelObserverInterface#onFocusChanged() call. More...
 
struct  alexaClientSDK::afml::test::TestClient::testClientInfo
 
class  alexaClientSDK::afml::test::MockActivityTrackerInterface
 A test observer that mocks out the ActivityTrackerInterface#notifyOfActivityUpdates() call. More...
 
struct  alexaClientSDK::afml::test::MockActivityTrackerInterface::ExpectedChannelStateResult
 Structure of expected Channel::State result from tests. More...
 
class  alexaClientSDK::afml::test::FocusChangeManager
 Manages testing focus changes. More...
 
class  alexaClientSDK::afml::test::FocusManagerTest
 Test fixture for testing FocusManager. More...
 
class  alexaClientSDK::afml::test::ChannelTest
 Test fixture for testing Channel. More...
 
struct  alexaClientSDK::afml::test::ChannelTest::ActivityUpdateElem
 

Namespaces

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

Typedefs

using alexaClientSDK::afml::test::JSONStream = std::vector< std::shared_ptr< std::istream > >
 Alias for JSON stream type used in ConfigurationNode initialization. More...
 

Functions

 alexaClientSDK::afml::test::TEST_F (FocusManagerTest, test_acquireInvalidChannelName)
 Tests acquireChannel with an invalid Channel name, expecting no focus changes to be made. More...
 
 alexaClientSDK::afml::test::TEST_F (FocusManagerTest, test_acquireChannelWithNoOtherChannelsActive)
 Tests acquireChannel, expecting to get Foreground status since no other Channels are active. More...
 
 alexaClientSDK::afml::test::TEST_F (FocusManagerTest, test_acquireLowerPriorityChannelWithOneHigherPriorityChannelTaken)
 
 alexaClientSDK::afml::test::TEST_F (FocusManagerTest, test_aquireLowerPriorityChannelWithTwoHigherPriorityChannelsTaken)
 
 alexaClientSDK::afml::test::TEST_F (FocusManagerTest, acquireVirtualChannelWithTwoLowerPriorityChannelsTaken)
 
 alexaClientSDK::afml::test::TEST_F (FocusManagerTest, test_acquireHigherPriorityChannelWithOneLowerPriorityChannelTaken)
 
 alexaClientSDK::afml::test::TEST_F (FocusManagerTest, test_kickOutActivityOnSameChannel)
 
 alexaClientSDK::afml::test::TEST_F (FocusManagerTest, test_simpleReleaseChannel)
 
 alexaClientSDK::afml::test::TEST_F (FocusManagerTest, test_simpleReleaseChannelWithIncorrectObserver)
 
 alexaClientSDK::afml::test::TEST_F (FocusManagerTest, test_releaseForegroundChannelWhileBackgroundChannelTaken)
 
 alexaClientSDK::afml::test::TEST_F (FocusManagerTest, test_simpleNonTargetedStop)
 
 alexaClientSDK::afml::test::TEST_F (FocusManagerTest, test_threeNonTargetedStopsWithThreeActivitiesHappening)
 
 alexaClientSDK::afml::test::TEST_F (FocusManagerTest, test_stopForegroundActivityAndAcquireDifferentChannel)
 
 alexaClientSDK::afml::test::TEST_F (FocusManagerTest, test_stopForegroundActivityAndAcquireSameChannel)
 
 alexaClientSDK::afml::test::TEST_F (FocusManagerTest, test_stopAllActivitiesWithSingleChannel)
 
 alexaClientSDK::afml::test::TEST_F (FocusManagerTest, test_stopAllActivitiesWithThreeChannels)
 
 alexaClientSDK::afml::test::TEST_F (FocusManagerTest, stopAllActivitiesWithSingleChannel)
 
 alexaClientSDK::afml::test::TEST_F (FocusManagerTest, stopAllActivitiesWithThreeChannels)
 
 alexaClientSDK::afml::test::TEST_F (FocusManagerTest, test_releaseBackgroundChannelWhileTwoChannelsTaken)
 
 alexaClientSDK::afml::test::TEST_F (FocusManagerTest, test_kickOutActivityOnSameChannelWhileOtherChannelsActive)
 
 alexaClientSDK::afml::test::TEST_F (FocusManagerTest, test_addObserver)
 Tests that multiple observers can be added, and that they are notified of all focus changes. More...
 
 alexaClientSDK::afml::test::TEST_F (FocusManagerTest, test_removeObserver)
 Tests that observers can be removed, and that they are no longer notified of focus changes after removal. More...
 
 alexaClientSDK::afml::test::TEST_F (FocusManagerTest, test_activityTracker)
 
 alexaClientSDK::afml::test::TEST_F (ChannelTest, test_getName)
 Tests that the getName method of Channel works properly. More...
 
 alexaClientSDK::afml::test::TEST_F (ChannelTest, test_getPriority)
 Tests that the getPriority method of Channel works properly. More...
 
 alexaClientSDK::afml::test::TEST_F (ChannelTest, test_setObserverThenSetFocus)
 Tests that the observer properly gets notified of focus changes. More...
 
 alexaClientSDK::afml::test::TEST_F (ChannelTest, test_priorityComparison)
 Tests that Channels are compared properly. More...
 
 alexaClientSDK::afml::test::TEST_F (ChannelTest, test_isChannelActive)
 Tests that a Channel correctly reports whether it is active. More...
 
 alexaClientSDK::afml::test::TEST_F (ChannelTest, test_getTimeAtIdle)
 
 alexaClientSDK::afml::test::TEST_F (ChannelTest, test_MultiActivity_NewActivityKicksExistingActivity)
 
 alexaClientSDK::afml::test::TEST_F (ChannelTest, test_MultiActivity_IncomingActivityWithPatience1)
 
 alexaClientSDK::afml::test::TEST_F (ChannelTest, test_MultiActivity_IncomingActivityWithPatience2)
 
 alexaClientSDK::afml::test::TEST_F (ChannelTest, test_MultiActivity_IncomingActivityWithPatience3)
 
 alexaClientSDK::afml::test::TEST_F (ChannelTest, test_MultiActivity_IncomingActivityWithPatience4)
 
 alexaClientSDK::afml::test::TEST_F (ChannelTest, test_MultiActivity_IncomingActivityWithPatience5)
 

Variables

static const auto alexaClientSDK::afml::test::SHORT_TIMEOUT = std::chrono::milliseconds(50)
 Short time out for when callbacks are expected not to occur. More...
 
static const auto alexaClientSDK::afml::test::DEFAULT_TIMEOUT = std::chrono::seconds(15)
 Long time out for the Channel observer to wait for the focus change callback (we should not reach this). More...
 
static const auto alexaClientSDK::afml::test::NO_ACTIVITY_UPDATE_TIMEOUT = std::chrono::milliseconds(250)
 Time out to wait for ActivityUpdates. More...
 
static const std::string alexaClientSDK::afml::test::DIALOG_CHANNEL_NAME = "Dialog"
 The dialog Channel name used in initializing the FocusManager. More...
 
static const std::string alexaClientSDK::afml::test::ALERTS_CHANNEL_NAME = "Alert"
 The alerts Channel name used in initializing the FocusManager. More...
 
static const std::string alexaClientSDK::afml::test::CONTENT_CHANNEL_NAME = "Content"
 The content Channel name used in initializing the FocusManager. More...
 
static const std::string alexaClientSDK::afml::test::INCORRECT_CHANNEL_NAME = "aksdjfl;aksdjfl;akdsjf"
 An incorrect Channel name that is never initialized as a Channel. More...
 
static const std::string alexaClientSDK::afml::test::VIRTUAL_CHANNEL_NAME = "VirtualChannel"
 The virtual Channel name used in initializing the FocusManager. More...
 
static const unsigned int alexaClientSDK::afml::test::VIRTUAL_CHANNEL_PRIORITY = 25
 The priority of the virtual Channel used in initializing the FocusManager. More...
 
static const unsigned int alexaClientSDK::afml::test::DIALOG_CHANNEL_PRIORITY = 10
 The priority of the dialog Channel used in initializing the FocusManager. More...
 
static const unsigned int alexaClientSDK::afml::test::ALERTS_CHANNEL_PRIORITY = 20
 The priority of the alerts Channel used in initializing the FocusManager. More...
 
static const unsigned int alexaClientSDK::afml::test::CONTENT_CHANNEL_PRIORITY = 30
 The priority of the content Channel used in initializing the FocusManager. More...
 
static const std::string alexaClientSDK::afml::test::DIALOG_INTERFACE_NAME = "dialog"
 Sample dialog interface name. More...
 
static const std::string alexaClientSDK::afml::test::ALERTS_INTERFACE_NAME = "alerts"
 Sample alerts interface name. More...
 
static const std::string alexaClientSDK::afml::test::CONTENT_INTERFACE_NAME = "content"
 Sample content interface name. More...
 
static const std::string alexaClientSDK::afml::test::DIFFERENT_CONTENT_INTERFACE_NAME = "different content"
 Another sample content interface name. More...
 
static const std::string alexaClientSDK::afml::test::DIFFERENT_DIALOG_INTERFACE_NAME = "different dialog"
 Another sample dialog interface name. More...
 
static const std::string alexaClientSDK::afml::test::VIRTUAL_INTERFACE_NAME = "virtual"
 Sample Virtual Channel interface name. More...
 
static const std::string alexaClientSDK::afml::test::INTERRUPT_MODEL_ROOT_KEY = "interruptModel"
 The root key for the InterruptModel in the InterruptModelConfiguration. More...
 
static const std::string alexaClientSDK::afml::test::INTERRUPT_MODEL_CONFIG_JSON
 The Json that describes the InterruptModelConfiguration. 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