2017-06-23 23:26:34 +00:00
|
|
|
/*
|
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
|
|
|
* Copyright 2017-2019 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-08-08 00:04:43 +00:00
|
|
|
#include <list>
|
2017-02-10 23:39:10 +00:00
|
|
|
#include <gtest/gtest.h>
|
|
|
|
|
|
|
|
#include "ExecutorTestUtils.h"
|
2017-06-23 23:26:34 +00:00
|
|
|
#include "AVSCommon/Utils/Threading/Executor.h"
|
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
|
|
|
#include "AVSCommon/Utils/WaitEvent.h"
|
2017-02-10 23:39:10 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
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
|
|
|
using namespace utils::test;
|
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
class ExecutorTest : public ::testing::Test {
|
2017-02-10 23:39:10 +00:00
|
|
|
public:
|
|
|
|
Executor executor;
|
|
|
|
};
|
|
|
|
|
2019-05-22 23:06:18 +00:00
|
|
|
TEST_F(ExecutorTest, test_submitStdFunctionAndVerifyExecution) {
|
2017-10-02 22:59:05 +00:00
|
|
|
std::function<void()> function = []() {};
|
2017-02-10 23:39:10 +00:00
|
|
|
auto future = executor.submit(function);
|
|
|
|
auto future_status = future.wait_for(SHORT_TIMEOUT_MS);
|
|
|
|
ASSERT_EQ(future_status, std::future_status::ready);
|
|
|
|
}
|
|
|
|
|
2019-05-22 23:06:18 +00:00
|
|
|
TEST_F(ExecutorTest, test_submitStdBindAndVerifyExecution) {
|
2017-02-10 23:39:10 +00:00
|
|
|
auto future = executor.submit(std::bind(exampleFunctionParams, 0));
|
|
|
|
auto future_status = future.wait_for(SHORT_TIMEOUT_MS);
|
|
|
|
ASSERT_EQ(future_status, std::future_status::ready);
|
|
|
|
}
|
|
|
|
|
2019-05-22 23:06:18 +00:00
|
|
|
TEST_F(ExecutorTest, test_submitLambdaAndVerifyExecution) {
|
2017-10-02 22:59:05 +00:00
|
|
|
auto future = executor.submit([]() {});
|
2017-02-10 23:39:10 +00:00
|
|
|
auto future_status = future.wait_for(SHORT_TIMEOUT_MS);
|
|
|
|
ASSERT_EQ(future_status, std::future_status::ready);
|
|
|
|
}
|
|
|
|
|
2019-05-22 23:06:18 +00:00
|
|
|
TEST_F(ExecutorTest, test_submitFunctionPointerAndVerifyExecution) {
|
2017-02-10 23:39:10 +00:00
|
|
|
auto future = executor.submit(&exampleFunction);
|
|
|
|
auto future_status = future.wait_for(SHORT_TIMEOUT_MS);
|
|
|
|
ASSERT_EQ(future_status, std::future_status::ready);
|
|
|
|
}
|
|
|
|
|
2019-05-22 23:06:18 +00:00
|
|
|
TEST_F(ExecutorTest, test_submitFunctorAndVerifyExecution) {
|
2017-02-10 23:39:10 +00:00
|
|
|
ExampleFunctor exampleFunctor;
|
|
|
|
auto future = executor.submit(exampleFunctor);
|
|
|
|
auto future_status = future.wait_for(SHORT_TIMEOUT_MS);
|
|
|
|
ASSERT_EQ(future_status, std::future_status::ready);
|
|
|
|
}
|
|
|
|
|
2019-05-22 23:06:18 +00:00
|
|
|
TEST_F(ExecutorTest, test_submitFunctionWithPrimitiveReturnTypeNoArgsAndVerifyExecution) {
|
2017-02-10 23:39:10 +00:00
|
|
|
int value = VALUE;
|
|
|
|
auto future = executor.submit([=]() { return value; });
|
|
|
|
auto future_status = future.wait_for(SHORT_TIMEOUT_MS);
|
|
|
|
ASSERT_EQ(future_status, std::future_status::ready);
|
|
|
|
ASSERT_EQ(future.get(), value);
|
|
|
|
}
|
|
|
|
|
2019-05-22 23:06:18 +00:00
|
|
|
TEST_F(ExecutorTest, test_submitFunctionWithObjectReturnTypeNoArgsAndVerifyExecution) {
|
2017-02-10 23:39:10 +00:00
|
|
|
SimpleObject value(VALUE);
|
|
|
|
auto future = executor.submit([=]() { return value; });
|
|
|
|
auto future_status = future.wait_for(SHORT_TIMEOUT_MS);
|
|
|
|
ASSERT_EQ(future_status, std::future_status::ready);
|
|
|
|
ASSERT_EQ(future.get().getValue(), value.getValue());
|
|
|
|
}
|
|
|
|
|
2019-05-22 23:06:18 +00:00
|
|
|
TEST_F(ExecutorTest, test_submitFunctionWithNoReturnTypePrimitiveArgsAndVerifyExecution) {
|
2017-02-10 23:39:10 +00:00
|
|
|
int value = VALUE;
|
2017-10-02 22:59:05 +00:00
|
|
|
auto future = executor.submit([](int number) {}, value);
|
2017-02-10 23:39:10 +00:00
|
|
|
auto future_status = future.wait_for(SHORT_TIMEOUT_MS);
|
|
|
|
ASSERT_EQ(future_status, std::future_status::ready);
|
|
|
|
}
|
|
|
|
|
2019-05-22 23:06:18 +00:00
|
|
|
TEST_F(ExecutorTest, test_submitFunctionWithNoReturnTypeObjectArgsAndVerifyExecution) {
|
2017-02-10 23:39:10 +00:00
|
|
|
SimpleObject arg(0);
|
2017-10-02 22:59:05 +00:00
|
|
|
auto future = executor.submit([](SimpleObject object) {}, arg);
|
2017-02-10 23:39:10 +00:00
|
|
|
auto future_status = future.wait_for(SHORT_TIMEOUT_MS);
|
|
|
|
ASSERT_EQ(future_status, std::future_status::ready);
|
|
|
|
}
|
|
|
|
|
2019-05-22 23:06:18 +00:00
|
|
|
TEST_F(ExecutorTest, test_submitFunctionWithPrimitiveReturnTypeObjectArgsAndVerifyExecution) {
|
2017-02-10 23:39:10 +00:00
|
|
|
int value = VALUE;
|
|
|
|
SimpleObject arg(0);
|
|
|
|
auto future = executor.submit([=](SimpleObject object) { return value; }, arg);
|
|
|
|
auto future_status = future.wait_for(SHORT_TIMEOUT_MS);
|
|
|
|
ASSERT_EQ(future_status, std::future_status::ready);
|
|
|
|
ASSERT_EQ(future.get(), value);
|
|
|
|
}
|
|
|
|
|
2019-05-22 23:06:18 +00:00
|
|
|
TEST_F(ExecutorTest, test_submitFunctionWithObjectReturnTypePrimitiveArgsAndVerifyExecution) {
|
2017-02-10 23:39:10 +00:00
|
|
|
int arg = 0;
|
|
|
|
SimpleObject value(VALUE);
|
|
|
|
auto future = executor.submit([=](int primitive) { return value; }, arg);
|
|
|
|
auto future_status = future.wait_for(SHORT_TIMEOUT_MS);
|
|
|
|
ASSERT_EQ(future_status, std::future_status::ready);
|
|
|
|
ASSERT_EQ(future.get().getValue(), value.getValue());
|
|
|
|
}
|
|
|
|
|
2019-05-22 23:06:18 +00:00
|
|
|
TEST_F(ExecutorTest, test_submitFunctionWithPrimitiveReturnTypePrimitiveArgsAndVerifyExecution) {
|
2017-02-10 23:39:10 +00:00
|
|
|
int arg = 0;
|
|
|
|
int value = VALUE;
|
|
|
|
auto future = executor.submit([=](int number) { return value; }, arg);
|
|
|
|
auto future_status = future.wait_for(SHORT_TIMEOUT_MS);
|
|
|
|
ASSERT_EQ(future_status, std::future_status::ready);
|
|
|
|
ASSERT_EQ(future.get(), value);
|
|
|
|
}
|
|
|
|
|
2019-05-22 23:06:18 +00:00
|
|
|
TEST_F(ExecutorTest, test_submitFunctionWithObjectReturnTypeObjectArgsAndVerifyExecution) {
|
2017-02-10 23:39:10 +00:00
|
|
|
SimpleObject value(VALUE);
|
|
|
|
SimpleObject arg(0);
|
|
|
|
auto future = executor.submit([=](SimpleObject object) { return value; }, arg);
|
|
|
|
auto future_status = future.wait_for(SHORT_TIMEOUT_MS);
|
|
|
|
ASSERT_EQ(future_status, std::future_status::ready);
|
|
|
|
ASSERT_EQ(future.get().getValue(), value.getValue());
|
|
|
|
}
|
|
|
|
|
2019-05-22 23:06:18 +00:00
|
|
|
TEST_F(ExecutorTest, test_submitToFront) {
|
2017-08-08 00:04:43 +00:00
|
|
|
std::atomic<bool> ready(false);
|
|
|
|
std::atomic<bool> blocked(false);
|
|
|
|
std::list<int> order;
|
|
|
|
|
|
|
|
// submit a task which will block the executor
|
2017-10-02 22:59:05 +00:00
|
|
|
executor.submit([&] {
|
|
|
|
blocked = true;
|
|
|
|
while (!ready) {
|
|
|
|
std::this_thread::yield();
|
2017-08-08 00:04:43 +00:00
|
|
|
}
|
2017-10-02 22:59:05 +00:00
|
|
|
});
|
2017-08-08 00:04:43 +00:00
|
|
|
|
|
|
|
// wait for it to block
|
|
|
|
while (!blocked) {
|
|
|
|
std::this_thread::yield();
|
|
|
|
}
|
|
|
|
|
|
|
|
// submit a task to the empty queue
|
|
|
|
executor.submit([&] { order.push_back(1); });
|
|
|
|
|
|
|
|
// submit a task to the back of the queue
|
|
|
|
executor.submit([&] { order.push_back(2); });
|
|
|
|
|
|
|
|
// submit a task to the front of the queue
|
|
|
|
executor.submitToFront([&] { order.push_back(3); });
|
|
|
|
|
|
|
|
// unblock the executor
|
|
|
|
ready = true;
|
|
|
|
|
|
|
|
// wait for all tasks to complete
|
|
|
|
executor.waitForSubmittedTasks();
|
|
|
|
|
|
|
|
// verify execution order
|
|
|
|
ASSERT_EQ(order.size(), 3U);
|
|
|
|
ASSERT_EQ(order.front(), 3);
|
|
|
|
ASSERT_EQ(order.back(), 2);
|
|
|
|
}
|
|
|
|
|
2019-05-22 23:06:18 +00:00
|
|
|
TEST_F(ExecutorTest, test_executionOrderEqualToSubmitOrder) {
|
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
|
|
|
WaitEvent waitSetUp;
|
|
|
|
executor.submit([&waitSetUp] { waitSetUp.wait(SHORT_TIMEOUT_MS); });
|
|
|
|
|
|
|
|
// submit a task which will block the executor
|
|
|
|
executor.submit([&waitSetUp] { waitSetUp.wait(SHORT_TIMEOUT_MS); });
|
|
|
|
|
|
|
|
std::list<int> order;
|
|
|
|
std::list<int> expectedOrder = {1, 2, 3};
|
|
|
|
for (auto& value : expectedOrder) {
|
|
|
|
// submit tasks in the expected order.
|
|
|
|
executor.submit([&order, value] { order.push_back(value); });
|
|
|
|
}
|
|
|
|
|
|
|
|
// unblock the executor
|
|
|
|
waitSetUp.wakeUp();
|
|
|
|
|
|
|
|
// wait for all tasks to complete
|
|
|
|
executor.waitForSubmittedTasks();
|
|
|
|
|
|
|
|
// verify execution order
|
|
|
|
ASSERT_EQ(order, expectedOrder);
|
|
|
|
}
|
|
|
|
|
2017-08-08 00:04:43 +00:00
|
|
|
/// Used by @c futureWaitsForTaskCleanup delay and timestamp the time of lambda parameter destruction.
|
|
|
|
struct SlowDestructor {
|
|
|
|
/// Constructor.
|
|
|
|
SlowDestructor() : cleanedUp{nullptr} {
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Destructor which delays destruction, timestamps, and notifies a condition variable when it is done
|
|
|
|
~SlowDestructor() {
|
|
|
|
if (cleanedUp) {
|
|
|
|
/* Delay briefly so that there is a measurable delay between the completion of the lambda's content and the
|
|
|
|
cleanup of the lambda's parameters */
|
|
|
|
std::this_thread::sleep_for(SHORT_TIMEOUT_MS / 10);
|
|
|
|
|
|
|
|
// Note the time when the destructor has (nominally) completed.
|
|
|
|
*cleanedUp = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Boolean indicating destruction is completed (if != nullptr). Mutable so that a lambda can write to it in a
|
|
|
|
* SlowDestructor parameter that is captured by value.
|
|
|
|
*/
|
2017-10-02 22:59:05 +00:00
|
|
|
mutable std::atomic<bool>* cleanedUp;
|
2017-08-08 00:04:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/// This test verifies that the executor waits to fulfill its promise until after the task is cleaned up.
|
2019-05-22 23:06:18 +00:00
|
|
|
TEST_F(ExecutorTest, test_futureWaitsForTaskCleanup) {
|
2017-08-08 00:04:43 +00:00
|
|
|
std::atomic<bool> cleanedUp(false);
|
|
|
|
SlowDestructor slowDestructor;
|
|
|
|
|
|
|
|
// Submit a lambda to execute which captures a parameter by value that is slow to destruct.
|
2017-10-02 22:59:05 +00:00
|
|
|
executor
|
|
|
|
.submit([slowDestructor, &cleanedUp] {
|
2017-08-08 00:04:43 +00:00
|
|
|
// Update the captured copy of slowDestructor so that it will delay destruction and update the cleanedUp
|
|
|
|
// flag.
|
|
|
|
slowDestructor.cleanedUp = &cleanedUp;
|
|
|
|
}
|
2017-10-02 22:59:05 +00:00
|
|
|
// wait for the promise to be fulfilled.
|
|
|
|
)
|
|
|
|
.wait();
|
2017-08-08 00:04:43 +00:00
|
|
|
|
|
|
|
ASSERT_TRUE(cleanedUp);
|
|
|
|
}
|
|
|
|
|
2017-08-17 00:13:40 +00:00
|
|
|
/// This test verifies that the shutdown function completes the current task and does not accept new tasks.
|
2019-05-22 23:06:18 +00:00
|
|
|
TEST_F(ExecutorTest, test_shutdown) {
|
2017-08-17 00:13:40 +00:00
|
|
|
std::atomic<bool> ready(false);
|
|
|
|
std::atomic<bool> blocked(false);
|
|
|
|
|
|
|
|
// submit a task which will block the executor and then sleep briefly
|
2017-10-02 22:59:05 +00:00
|
|
|
auto done = executor.submit([&] {
|
|
|
|
blocked = true;
|
|
|
|
while (!ready) {
|
|
|
|
std::this_thread::yield();
|
2017-08-17 00:13:40 +00:00
|
|
|
}
|
2017-10-02 22:59:05 +00:00
|
|
|
std::this_thread::sleep_for(SHORT_TIMEOUT_MS);
|
|
|
|
});
|
2017-08-17 00:13:40 +00:00
|
|
|
|
|
|
|
// wait for it to block
|
|
|
|
while (!blocked) {
|
|
|
|
std::this_thread::yield();
|
|
|
|
}
|
|
|
|
|
|
|
|
// release the task to start sleeping
|
|
|
|
ready = true;
|
|
|
|
|
|
|
|
// shut down the executor
|
|
|
|
EXPECT_FALSE(executor.isShutdown());
|
|
|
|
executor.shutdown();
|
|
|
|
EXPECT_TRUE(executor.isShutdown());
|
|
|
|
|
|
|
|
// verify that the task has now completed
|
|
|
|
EXPECT_TRUE(done.valid());
|
|
|
|
done.get();
|
|
|
|
|
|
|
|
// try to submit a new task and verify that it is rejected
|
|
|
|
auto rejected = executor.submit([] {});
|
|
|
|
ASSERT_FALSE(rejected.valid());
|
|
|
|
}
|
|
|
|
|
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
|
|
|
/// Test that calling submit after shutdown will fail the job.
|
2019-05-22 23:06:18 +00:00
|
|
|
TEST_F(ExecutorTest, test_pushAfterExecutordownFail) {
|
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
|
|
|
executor.shutdown();
|
|
|
|
ASSERT_TRUE(executor.isShutdown());
|
|
|
|
|
|
|
|
EXPECT_FALSE(executor.submit([] {}).valid());
|
|
|
|
EXPECT_FALSE(executor.submitToFront([] {}).valid());
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Test that shutdown cancel jobs in the queue.
|
2019-05-22 23:06:18 +00:00
|
|
|
TEST_F(ExecutorTest, test_shutdownCancelJob) {
|
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
|
|
|
bool executed = false;
|
|
|
|
WaitEvent waitSetUp, waitJobStart;
|
|
|
|
std::future<void> jobToDropResult;
|
|
|
|
|
|
|
|
// Job that should be cancelled and never run.
|
|
|
|
auto jobToDrop = [&executed] { executed = true; };
|
|
|
|
|
|
|
|
// Job used to validate that jobToDrop return value becomes available (but invalid).
|
|
|
|
auto jobToWaitDrop = [&jobToDropResult, &waitSetUp, &waitJobStart] {
|
|
|
|
waitJobStart.wakeUp();
|
|
|
|
waitSetUp.wait(SHORT_TIMEOUT_MS);
|
|
|
|
jobToDropResult.wait_for(SHORT_TIMEOUT_MS);
|
|
|
|
};
|
|
|
|
|
|
|
|
// 1st job waits for setup to be done then wait for the second job to be cancelled.
|
|
|
|
executor.submit(jobToWaitDrop);
|
|
|
|
|
|
|
|
// 2nd job that should never run. When cancelled, its return will become available.
|
|
|
|
jobToDropResult = executor.submit(jobToDrop);
|
|
|
|
|
|
|
|
// Wake up first job and wait for it to start running.
|
|
|
|
waitSetUp.wakeUp();
|
|
|
|
waitJobStart.wait();
|
|
|
|
|
|
|
|
// Shutdown should cancel enqueued jobs and wait for the ongoing job.
|
|
|
|
executor.shutdown();
|
|
|
|
|
|
|
|
// Executed should still be false.
|
|
|
|
EXPECT_FALSE(executed);
|
|
|
|
}
|
2017-10-02 22:59:05 +00:00
|
|
|
} // namespace test
|
|
|
|
} // namespace threading
|
|
|
|
} // namespace utils
|
|
|
|
} // namespace avsCommon
|
|
|
|
} // namespace alexaClientSDK
|