aboutsummaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorArthur Ishiguro <arthuri@google.com>2020-05-13 12:10:00 -0700
committerArthur Ishiguro <arthuri@google.com>2020-05-15 07:20:50 -0700
commit390f6ed63a43f5e941e85291b7e0337f82e422df (patch)
tree5df30b1affb503950fd54a8a6227816c83a55f20 /apps
parenta9bc8946debba73e591818bd8734fdbc26545ec8 (diff)
downloadchre-390f6ed63a43f5e941e85291b7e0337f82e422df.tar.gz
Audio concurrency test: add timeout handling
Bug: 156296364 Test: Modify CHRE to not dispatch audio data, verify test fails with timeout Change-Id: I2e37715e2ed4220b936995463133132167f37d6d
Diffstat (limited to 'apps')
-rw-r--r--apps/test/common/chre_audio_concurrency_test/src/chre_audio_concurrency_test_manager.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/apps/test/common/chre_audio_concurrency_test/src/chre_audio_concurrency_test_manager.cc b/apps/test/common/chre_audio_concurrency_test/src/chre_audio_concurrency_test_manager.cc
index 9e420bb2..13c37b3f 100644
--- a/apps/test/common/chre_audio_concurrency_test/src/chre_audio_concurrency_test_manager.cc
+++ b/apps/test/common/chre_audio_concurrency_test/src/chre_audio_concurrency_test_manager.cc
@@ -157,7 +157,12 @@ void Manager::handleDataFromChre(uint16_t eventType, const void *eventData) {
}
void Manager::handleTimer() {
- // TODO: Timeout failure
+ if (mTimerHandle != CHRE_TIMER_INVALID && mTestSession.has_value()) {
+ LOGE("Timed out during test: step %" PRIu8, mTestSession->step);
+ sendTestResultToHost(mTestSession->hostEndpointId, kTestResultMessageType,
+ false /* success */);
+ mTestSession.reset();
+ }
}
bool Manager::setTimeoutTimer(size_t durationSeconds) {
@@ -189,6 +194,8 @@ void Manager::handleAudioDataEvent(const chreAudioDataEvent *data) {
// Reset the test session to avoid sending multiple TEST_AUDIO_ENABLED
// messages to the host, while we wait for the next step.
mTestSession.reset();
+
+ // TODO: Perform sanity check on audio data
break;
}