From 68df40f9cf3b8be9c9453b9468f73dc6e049ad20 Mon Sep 17 00:00:00 2001 From: Ray Essick Date: Fri, 1 Jun 2018 16:22:29 -0700 Subject: [PATCH] VtsHalMediaOmx should test functionality only The tests insisted on presence of codecs as well as functionality, but the list it reads is a superset of what may be on the device. Modified so that if a codec is not present, we ignore it rather than failing the test. The Vts tests that check OMX Store are being augmented to ensure any advertised codecs are indeed present. Bug: 80029024 Bug: 80530946 Test: vts run VtsHalMediaOmxV1_0Host Change-Id: Icd6d049c5c0d31f47ef3dbda52d6927e38bd894d --- .../audio/VtsHalMediaOmxV1_0TargetAudioDecTest.cpp | 5 +++++ .../audio/VtsHalMediaOmxV1_0TargetAudioEncTest.cpp | 5 +++++ .../component/VtsHalMediaOmxV1_0TargetComponentTest.cpp | 5 +++++ .../video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp | 5 +++++ .../video/VtsHalMediaOmxV1_0TargetVideoEncTest.cpp | 5 +++++ 5 files changed, 25 insertions(+) diff --git a/media/omx/1.0/vts/functional/audio/VtsHalMediaOmxV1_0TargetAudioDecTest.cpp b/media/omx/1.0/vts/functional/audio/VtsHalMediaOmxV1_0TargetAudioDecTest.cpp index 42f99471d2..725e2904ea 100644 --- a/media/omx/1.0/vts/functional/audio/VtsHalMediaOmxV1_0TargetAudioDecTest.cpp +++ b/media/omx/1.0/vts/functional/audio/VtsHalMediaOmxV1_0TargetAudioDecTest.cpp @@ -86,6 +86,11 @@ class AudioDecHidlTest : public ::testing::VtsHalHidlTargetTestBase { this->omxNode = _nl; }) .isOk()); + if (status == android::hardware::media::omx::V1_0::Status::NAME_NOT_FOUND) { + disableTest = true; + std::cout << "[ WARN ] Test Disabled, component not present\n"; + return; + } ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK); ASSERT_NE(omxNode, nullptr); ASSERT_NE(gEnv->getRole().empty(), true) << "Invalid Component Role"; diff --git a/media/omx/1.0/vts/functional/audio/VtsHalMediaOmxV1_0TargetAudioEncTest.cpp b/media/omx/1.0/vts/functional/audio/VtsHalMediaOmxV1_0TargetAudioEncTest.cpp index d5f1f2da37..0ebab886e4 100644 --- a/media/omx/1.0/vts/functional/audio/VtsHalMediaOmxV1_0TargetAudioEncTest.cpp +++ b/media/omx/1.0/vts/functional/audio/VtsHalMediaOmxV1_0TargetAudioEncTest.cpp @@ -86,6 +86,11 @@ class AudioEncHidlTest : public ::testing::VtsHalHidlTargetTestBase { this->omxNode = _nl; }) .isOk()); + if (status == android::hardware::media::omx::V1_0::Status::NAME_NOT_FOUND) { + disableTest = true; + std::cout << "[ WARN ] Test Disabled, component not present\n"; + return; + } ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK); ASSERT_NE(omxNode, nullptr); ASSERT_NE(gEnv->getRole().empty(), true) << "Invalid Component Role"; diff --git a/media/omx/1.0/vts/functional/component/VtsHalMediaOmxV1_0TargetComponentTest.cpp b/media/omx/1.0/vts/functional/component/VtsHalMediaOmxV1_0TargetComponentTest.cpp index f7c843363c..7750a12fac 100644 --- a/media/omx/1.0/vts/functional/component/VtsHalMediaOmxV1_0TargetComponentTest.cpp +++ b/media/omx/1.0/vts/functional/component/VtsHalMediaOmxV1_0TargetComponentTest.cpp @@ -80,6 +80,11 @@ class ComponentHidlTest : public ::testing::VtsHalHidlTargetTestBase { this->omxNode = _nl; }) .isOk()); + if (status == android::hardware::media::omx::V1_0::Status::NAME_NOT_FOUND) { + disableTest = true; + std::cout << "[ WARN ] Test Disabled, component not present\n"; + return; + } ASSERT_EQ(status, android::hardware::media::omx::V1_0::Status::OK); ASSERT_NE(omxNode, nullptr); ASSERT_NE(gEnv->getRole().empty(), true) << "Invalid Component Role"; diff --git a/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp b/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp index 40e76c9a3b..1db9f7531a 100644 --- a/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp +++ b/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp @@ -87,6 +87,11 @@ class VideoDecHidlTest : public ::testing::VtsHalHidlTargetTestBase { this->omxNode = _nl; }) .isOk()); + if (status == android::hardware::media::omx::V1_0::Status::NAME_NOT_FOUND) { + disableTest = true; + std::cout << "[ WARN ] Test Disabled, component not present\n"; + return; + } ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK); ASSERT_NE(omxNode, nullptr); ASSERT_NE(gEnv->getRole().empty(), true) << "Invalid Component Role"; diff --git a/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoEncTest.cpp b/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoEncTest.cpp index 2056d9e670..a740a8093b 100644 --- a/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoEncTest.cpp +++ b/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoEncTest.cpp @@ -100,6 +100,11 @@ class VideoEncHidlTest : public ::testing::VtsHalHidlTargetTestBase { this->omxNode = _nl; }) .isOk()); + if (status == android::hardware::media::omx::V1_0::Status::NAME_NOT_FOUND) { + disableTest = true; + std::cout << "[ WARN ] Test Disabled, component not present\n"; + return; + } ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK); ASSERT_NE(omxNode, nullptr); ASSERT_NE(gEnv->getRole().empty(), true) << "Invalid Component Role";