AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Classes | Namespaces | Functions | Variables
SpeakerManagerTest.cpp File Reference
#include <future>
#include <gtest/gtest.h>
#include <memory>
#include <rapidjson/document.h>
#include <rapidjson/stringbuffer.h>
#include <rapidjson/writer.h>
#include <set>
#include <vector>
#include <acsdk/SpeakerManager/private/SpeakerManagerConstants.h>
#include <acsdk/SpeakerManager/SpeakerManagerStorageInterface.h>
#include <acsdk/SpeakerManager/private/SpeakerManager.h>
#include <acsdk/SpeakerManager/test/MockSpeakerManagerConfig.h>
#include <acsdk/SpeakerManager/test/MockSpeakerManagerObserver.h>
#include <acsdk/SpeakerManager/test/MockSpeakerManagerStorage.h>
#include <acsdk/Test/GmockExtensions.h>
#include <AVSCommon/AVS/Attachment/MockAttachmentManager.h>
#include <AVSCommon/SDKInterfaces/MockChannelVolumeInterface.h>
#include <AVSCommon/SDKInterfaces/MockContextManager.h>
#include <AVSCommon/SDKInterfaces/MockDirectiveHandlerResult.h>
#include <AVSCommon/SDKInterfaces/MockExceptionEncounteredSender.h>
#include <AVSCommon/SDKInterfaces/MockMessageSender.h>
#include <AVSCommon/SDKInterfaces/MockSpeakerInterface.h>
#include <AVSCommon/SDKInterfaces/SpeakerManagerObserverInterface.h>
#include <AVSCommon/Utils/Memory/Memory.h>
#include <AVSCommon/Utils/Metrics/MockMetricRecorder.h>
Include dependency graph for SpeakerManagerTest.cpp:

Classes

class  alexaClientSDK::speakerManager::test::MockSpeakerManagerStorageWithHelpers
 Extend MockSpeakerManagerStorage with helpers. More...
 
class  alexaClientSDK::speakerManager::test::SpeakerManagerTest
 Test fixture for SpeakerManager unit tests. More...
 

Namespaces

 alexaClientSDK
 Whether or not curl logs should be emitted.
 
 alexaClientSDK::speakerManager
 Speaker API Capability Agent Interface and Implementation.
 
 alexaClientSDK::speakerManager::test
 Unit Tests and Mocks for Speaker API Capability Agent.
 

Functions

static std::chrono::milliseconds alexaClientSDK::speakerManager::test::TIMEOUT (1000)
 Timeout when waiting for futures to be set. More...
 
std::string alexaClientSDK::speakerManager::test::generateVolumeStateJson (SpeakerInterface::SpeakerSettings settings)
 Helper function to generate the VolumeState in JSON for the ContextManager. More...
 
 alexaClientSDK::speakerManager::test::TEST_F (SpeakerManagerTest, test_nullContextManager)
 
 alexaClientSDK::speakerManager::test::TEST_F (SpeakerManagerTest, test_nullMessageSender)
 
 alexaClientSDK::speakerManager::test::TEST_F (SpeakerManagerTest, test_nullExceptionSender)
 
 alexaClientSDK::speakerManager::test::TEST_F (SpeakerManagerTest, test_noChannelVolumeInterfaces)
 
 alexaClientSDK::speakerManager::test::TEST_F (SpeakerManagerTest, test_addChannelVolumeInterfaceDoesNotOverwriteDefaults)
 
 alexaClientSDK::speakerManager::test::TEST_F (SpeakerManagerTest, test_contextManagerSetStateConstructor)
 
 alexaClientSDK::speakerManager::test::TEST_F (SpeakerManagerTest, test_setVolumeUnderBounds)
 
 alexaClientSDK::speakerManager::test::TEST_F (SpeakerManagerTest, test_setVolumeUnderBoundsWithPersistentStorage)
 
 alexaClientSDK::speakerManager::test::TEST_F (SpeakerManagerTest, test_setVolumeOverBounds)
 
 alexaClientSDK::speakerManager::test::TEST_F (SpeakerManagerTest, test_setVolumeOverBoundsWithPersistentStorage)
 
 alexaClientSDK::speakerManager::test::TEST_F (SpeakerManagerTest, test_adjustVolumeUnderBounds)
 
 alexaClientSDK::speakerManager::test::TEST_F (SpeakerManagerTest, test_adjustVolumeUnderBoundsWithPersistentStorage)
 
 alexaClientSDK::speakerManager::test::TEST_F (SpeakerManagerTest, test_adjustVolumeOverBounds)
 
 alexaClientSDK::speakerManager::test::TEST_F (SpeakerManagerTest, test_adjustVolumeOverBoundsWithPersistentStorage)
 
 alexaClientSDK::speakerManager::test::TEST_F (SpeakerManagerTest, test_getCachedSettings)
 
 alexaClientSDK::speakerManager::test::TEST_F (SpeakerManagerTest, test_eventNotSentWhenAdjustVolumeUnchanged)
 
 alexaClientSDK::speakerManager::test::TEST_F (SpeakerManagerTest, test_eventNotSentWhenAdjustVolumeUnchangedWithPersistentStorage)
 
 alexaClientSDK::speakerManager::test::TEST_F (SpeakerManagerTest, test_eventNotSentWhenSetVolumeUnchanged)
 
 alexaClientSDK::speakerManager::test::TEST_F (SpeakerManagerTest, test_eventNotSentWhenSetVolumeUnchangedWithPersistentStorage)
 
 alexaClientSDK::speakerManager::test::TEST_F (SpeakerManagerTest, test_getConfiguration)
 
 alexaClientSDK::speakerManager::test::TEST_F (SpeakerManagerTest, test_addDuplicatedChannelVolumeInterfaces)
 
 alexaClientSDK::speakerManager::test::TEST_F (SpeakerManagerTest, test_addNullObserver)
 
 alexaClientSDK::speakerManager::test::TEST_F (SpeakerManagerTest, test_removeSpeakerManagerObserver)
 
 alexaClientSDK::speakerManager::test::TEST_F (SpeakerManagerTest, test_removeNullObserver)
 
 alexaClientSDK::speakerManager::test::TEST_F (SpeakerManagerTest, test_retryAndApplySettingsForSetVolume)
 
 alexaClientSDK::speakerManager::test::TEST_F (SpeakerManagerTest, test_retryAndApplySettingsForAdjustVolume)
 
 alexaClientSDK::speakerManager::test::TEST_F (SpeakerManagerTest, test_retryAndApplySettingsForSetMute)
 
 alexaClientSDK::speakerManager::test::TEST_F (SpeakerManagerTest, test_retryAndApplySettingsFails)
 
 alexaClientSDK::speakerManager::test::INSTANTIATE_TEST_CASE_P (Parameterized, SpeakerManagerTest, ::testing::Values(std::vector< ChannelVolumeInterface::Type >{ ChannelVolumeInterface::Type::AVS_SPEAKER_VOLUME }, std::vector< ChannelVolumeInterface::Type >{ ChannelVolumeInterface::Type::AVS_ALERTS_VOLUME }, std::vector< ChannelVolumeInterface::Type >{ ChannelVolumeInterface::Type::AVS_SPEAKER_VOLUME, ChannelVolumeInterface::Type::AVS_SPEAKER_VOLUME }, std::vector< ChannelVolumeInterface::Type >{ ChannelVolumeInterface::Type::AVS_ALERTS_VOLUME, ChannelVolumeInterface::Type::AVS_ALERTS_VOLUME, }, std::vector< ChannelVolumeInterface::Type >{ ChannelVolumeInterface::Type::AVS_SPEAKER_VOLUME, ChannelVolumeInterface::Type::AVS_ALERTS_VOLUME, ChannelVolumeInterface::Type::AVS_SPEAKER_VOLUME, ChannelVolumeInterface::Type::AVS_ALERTS_VOLUME }))
 
 alexaClientSDK::speakerManager::test::TEST_P (SpeakerManagerTest, test_setVolume)
 
 alexaClientSDK::speakerManager::test::TEST_P (SpeakerManagerTest, test_setVolumeWithPersistentStorage)
 
 alexaClientSDK::speakerManager::test::TEST_P (SpeakerManagerTest, test_onExternalSpeakerSettingsUpdate)
 
 alexaClientSDK::speakerManager::test::TEST_P (SpeakerManagerTest, test_onExternalSpeakerSettingsUpdateWithPersistentStorage)
 
 alexaClientSDK::speakerManager::test::TEST_F (SpeakerManagerTest, test_eventNotSentWhenOnExternalSpeakerSettingsUpdateUnchanged)
 
 alexaClientSDK::speakerManager::test::TEST_F (SpeakerManagerTest, test_eventNotSentWhenOnExternalSpeakerSettingsUpdateUnchangedWithPersistentStorage)
 
 alexaClientSDK::speakerManager::test::TEST_F (SpeakerManagerTest, test_onExternalSpeakerSettingsUpdateUnderBounds)
 
 alexaClientSDK::speakerManager::test::TEST_F (SpeakerManagerTest, test_onExternalSpeakerSettingsUpdateUnderBoundsWithPersistentStorage)
 
 alexaClientSDK::speakerManager::test::TEST_F (SpeakerManagerTest, test_onExternalSpeakerSettingsUpdateOverBounds)
 
 alexaClientSDK::speakerManager::test::TEST_F (SpeakerManagerTest, test_onExternalSpeakerSettingsUpdateOverBoundsWithPersistentStorage)
 
 alexaClientSDK::speakerManager::test::TEST_P (SpeakerManagerTest, test_adjustVolume)
 
 alexaClientSDK::speakerManager::test::TEST_P (SpeakerManagerTest, test_adjustVolumeWithPersistentStorage)
 
 alexaClientSDK::speakerManager::test::TEST_P (SpeakerManagerTest, test_setMute)
 
 alexaClientSDK::speakerManager::test::TEST_P (SpeakerManagerTest, test_setMuteWithPersistentStorage)
 
 alexaClientSDK::speakerManager::test::TEST_P (SpeakerManagerTest, test_getSpeakerSettings)
 
 alexaClientSDK::speakerManager::test::TEST_P (SpeakerManagerTest, test_setVolumeDirective)
 
 alexaClientSDK::speakerManager::test::TEST_P (SpeakerManagerTest, test_setVolumeDirectiveWithPersistentStorage)
 
 alexaClientSDK::speakerManager::test::TEST_P (SpeakerManagerTest, test_adjustVolumeDirective)
 
 alexaClientSDK::speakerManager::test::TEST_P (SpeakerManagerTest, test_adjustVolumeDirectiveWithPersistentStorage)
 
 alexaClientSDK::speakerManager::test::TEST_P (SpeakerManagerTest, test_setMuteDirective)
 
 alexaClientSDK::speakerManager::test::TEST_P (SpeakerManagerTest, test_setMuteDirectiveWithPersistentStorage)
 
 alexaClientSDK::speakerManager::test::TEST_P (SpeakerManagerTest, test_setVolumeDirectiveWhenMuted)
 
 alexaClientSDK::speakerManager::test::TEST_P (SpeakerManagerTest, test_getSpeakerConfigDefaults)
 
 alexaClientSDK::speakerManager::test::TEST_P (SpeakerManagerTest, test_getSpeakerConfigFromStorage)
 

Variables

static const auto alexaClientSDK::speakerManager::test::MESSAGE_ID = "messageId"
 The MessageId identifer. More...
 
static const auto alexaClientSDK::speakerManager::test::VOLUME_PAYLOAD
 A SetVolume/AdjustVolume payload. More...
 
static const auto alexaClientSDK::speakerManager::test::MUTE_PAYLOAD
 A SetMute payload. More...
 
static const auto alexaClientSDK::speakerManager::test::UNMUTE_PAYLOAD
 A SetMute payload to unmute. More...
 
static const int8_t alexaClientSDK::speakerManager::test::VALID_VOLUME_ADJUSTMENT = 10
 A valid delta to adjust the volume. 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