2017-06-23 23:26:34 +00:00
|
|
|
/*
|
2020-04-13 22:56:35 +00:00
|
|
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
2017-02-10 23:39:10 +00:00
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License").
|
|
|
|
* You may not use this file except in compliance with the License.
|
|
|
|
* A copy of the License is located at
|
|
|
|
*
|
|
|
|
* http://aws.amazon.com/apache2.0/
|
|
|
|
*
|
|
|
|
* or in the "license" file accompanying this file. This file is distributed
|
|
|
|
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
|
|
|
* express or implied. See the License for the specific language governing
|
|
|
|
* permissions and limitations under the License.
|
|
|
|
*/
|
2017-12-09 00:07:37 +00:00
|
|
|
|
|
|
|
#ifndef ALEXA_CLIENT_SDK_AVSCOMMON_UTILS_TEST_EXECUTORTESTUTILS_H_
|
|
|
|
#define ALEXA_CLIENT_SDK_AVSCOMMON_UTILS_TEST_EXECUTORTESTUTILS_H_
|
|
|
|
|
2017-02-10 23:39:10 +00:00
|
|
|
#include <chrono>
|
|
|
|
|
|
|
|
namespace alexaClientSDK {
|
2017-06-23 23:26:34 +00:00
|
|
|
namespace avsCommon {
|
|
|
|
namespace utils {
|
2017-02-10 23:39:10 +00:00
|
|
|
namespace threading {
|
2017-06-09 23:23:31 +00:00
|
|
|
namespace test {
|
2017-02-10 23:39:10 +00:00
|
|
|
|
|
|
|
/// Simple integer value to be reused in tests
|
|
|
|
static const int VALUE = 1234;
|
|
|
|
|
Version 1.12 alexa-client-sdk
Changes in this update:
**Enhancements**
* Support was added for the `fr_CA` locale.
* The Executor has been optimized to run a single thread when there are active job in the queue, and to remain idle when there are not active jobs.
* An additional parameter of `alertType` has been added to the Alerts capability agent. This will allow observers of alerts to know the type of alert being delivered.
* Support for programmatic unload and load of PulseAudio Bluetooth modules was added. To enable this feature, there is a [new CMake option](https://github.com/alexa/avs-device-sdk/wiki/CMake-parameters#bluetooth): `BLUETOOTH_BLUEZ_PULSEAUDIO_OVERRIDE_ENDPOINTS`. Note that [libpulse-dev is a required dependency](https://github.com/alexa/avs-device-sdk/wiki/Dependencies#bluetooth) of this feature.
* An observer interface was added for when an active Bluetooth device connects and disconnects.
* The `BluetoothDeviceManagerInterface` instantiation was moved from `DefaultClient` to `SampleApp` to allow applications to override it.
* The `MediaPlayerInterface` now supports repeating playback of URL sources.
* The Kitt.AI wake word engine (WWE) is now compatible with GCC5+.
* Stop of ongoing alerts, management of MessageObservers, and management of CallStateObservers have been exposed through DefaultClient.
**Bug Fixes**
* [Issue 953](https://github.com/alexa/avs-device-sdk/issues/953) - The `MediaPlayerInterface` requirement that callbacks not be made upon a callers thread has been removed.
* [Issue 1136](https://github.com/alexa/avs-device-sdk/issues/1136) - Added a missing default virtual destructor.
* [Issue 1140](https://github.com/alexa/avs-device-sdk/issues/1140) - Fixed an issue where DND states were not synchronized to the AVS cloud after device reset.
* [Issue 1143](https://github.com/alexa/avs-device-sdk/issues/1143) - Fixed an issue in which the SpeechSynthesizer couldn't enter a sleeping state.
* [Issue 1183](https://github.com/alexa/avs-device-sdk/issues/1183) - Fixed an issue where alarm is not sounding for certain timezones
* Changing an alert's volume from the Alexa app now works when an alert is playing.
* Added missing shutdown handling for ContentDecrypter to prevent the `Stop` command from triggering a crash when SAMPLE-AES encrypted content was streaming.
* Fixed a bug where if the Notifications database is empty, due to a crash or corruption, the SDK initialization process enters an infinite loop when it retries to get context from the Notifications capability agent.
* Fixed a race condition that caused `AlertsRenderer` observers to miss notification that an alert has been completed.
**Known Issues**
* `PlaylistParser` and `IterativePlaylistParser` generate two HTTP requests (one to fetch the content type, and one to fetch the audio data) for each audio stream played.
* Music playback history isn't being displayed in the Alexa app for certain account and device types.
* On GCC 8+, issues related to `-Wclass-memaccess` will trigger warnings. However, this won't cause the build to fail and these warnings can be ignored.
* Android error ("libDefaultClient.so" not found) can be resolved by upgrading to ADB version 1.0.40
* When network connection is lost, lost connection status is not returned via local TTS.
* `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* The Alexa app doesn't always indicate when a device is successfully connected via Bluetooth.
* Connecting a product to streaming media via Bluetooth will sometimes stop media playback within the source application. Resuming playback through the source application or toggling next/previous will correct playback.
* When a source device is streaming silence via Bluetooth, the Alexa app indicates that audio content is streaming.
* The Bluetooth agent assumes that the Bluetooth adapter is always connected to a power source. Disconnecting from a power source during operation is not yet supported.
* On some products, interrupted Bluetooth playback may not resume if other content is locally streamed.
* `make integration` is currently not available for Android. In order to run integration tests on Android, you'll need to manually upload the test binary file along with any input file. At that point, the adb can be used to run the integration tests.
* On Raspberry Pi running Android Things with HDMI output audio, beginning of speech is truncated when Alexa responds to user text-to-speech (TTS).
* When the sample app is restarted and network connection is lost, Reminder TTS does not play. Instead, the default alarm tone will play twice.
2019-02-26 00:45:37 +00:00
|
|
|
/// Timeout to use for waiting on calls within tests
|
|
|
|
static const std::chrono::milliseconds SHORT_TIMEOUT_MS = std::chrono::milliseconds(100);
|
2017-02-10 23:39:10 +00:00
|
|
|
|
|
|
|
/// A simple task which takes an integer argument and returns the argument when executed
|
|
|
|
static auto TASK = [](int arg) { return arg; };
|
|
|
|
|
|
|
|
/// Simple example function to be referenced in Executor related tests
|
|
|
|
void exampleFunction() {
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Simple example function which takes a parameter to be referenced in Executor related tests
|
|
|
|
void exampleFunctionParams(int param) {
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* ExampleFunctor is an example of a functor object, to be used in Executor related tests
|
|
|
|
*/
|
|
|
|
class ExampleFunctor {
|
|
|
|
public:
|
|
|
|
void operator()() {
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* SimpleObject is an object intended to be used as an argument or return type of functions used in Executor related
|
|
|
|
* tests
|
|
|
|
*/
|
|
|
|
class SimpleObject {
|
|
|
|
public:
|
2017-10-02 22:59:05 +00:00
|
|
|
SimpleObject() : m_value{0} {};
|
|
|
|
SimpleObject(int value) : m_value{value} {};
|
2017-02-10 23:39:10 +00:00
|
|
|
|
|
|
|
int getValue() {
|
|
|
|
return m_value;
|
|
|
|
}
|
2017-10-02 22:59:05 +00:00
|
|
|
|
2017-02-10 23:39:10 +00:00
|
|
|
private:
|
|
|
|
int m_value;
|
|
|
|
};
|
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
} // namespace test
|
|
|
|
} // namespace threading
|
|
|
|
} // namespace utils
|
|
|
|
} // namespace avsCommon
|
|
|
|
} // namespace alexaClientSDK
|
2017-12-09 00:07:37 +00:00
|
|
|
|
|
|
|
#endif // ALEXA_CLIENT_SDK_AVSCOMMON_UTILS_TEST_EXECUTORTESTUTILS_H_
|