Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ae811bc8 authored by Lajos Molnar's avatar Lajos Molnar Committed by Automerger Merge Worker
Browse files

Merge changes I0ced4012,I9b1f8ed9,Iba2a7259,I8174b895 am: a9f74717

Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1378762

Change-Id: I2af85f22f27b85e9e0e2bb9af93f007f4fc0f80e
parents 94958980 a9f74717
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
## Omx Hal @ 1.0 tests ##
---
## Overview :
The scope of the tests presented here is not restricted solely to testing omx hal @ 1.0 API but also test to omx core functionality and to an extent omx components as well. The current directory contains the following folders: audio, common, component, master and video. Besides common all other folders contain test fixtures for testing AV decoder, encoder components. Common constitutes files that are used across by these test applications.
The scope of the tests presented here is not restricted solely to testing omx hal @ 1.0 API but also test to omx core functionality and to an extent omx components as well. The current directory contains the following folders: audio, common, component, store and video. Besides common all other folders contain test fixtures for testing AV decoder, encoder components. Common constitutes files that are used across by these test applications.

#### master :
Functionality of master is to enumerate all the omx components (and the roles it supports) available in android media framework.
#### store :
Functionality of store is to enumerate all the omx components (and the roles it supports) available in android media framework.

usage: atest VtsHalMediaOmxV1\_0TargetMasterTest
usage: atest VtsHalMediaOmxV1\_0TargetStoreTest

#### component :
This folder includes test fixtures that tests aspects common to all omx compatible components. For instance, port enabling/disabling, enumerating port formats, state transitions, flush, ..., stay common to all components irrespective of the service they offer. Test fixtures here are directed towards testing these (omx core). Every standard OMX compatible component is expected to pass these tests.
+2 −2
Original line number Diff line number Diff line
@@ -785,8 +785,8 @@ const std::vector<std::tuple<std::string, std::string, std::string>>& getTestPar
        for (IOmx::ComponentInfo info : componentInfos) {
            for (std::string role : info.mRoles) {
                if (filter.empty()) {
                    if (kWhiteListRoles.find(role.c_str()) == kWhiteListRoles.end()) {
                        // This is for component test and the role is not in the white list.
                    if (kKnownRoles.find(role.c_str()) == kKnownRoles.end()) {
                        // This is for component test and the role is not supported.
                        continue;
                    }
                } else if (role.find(filter) == std::string::npos) {
+2 −2
Original line number Diff line number Diff line
@@ -78,8 +78,8 @@ enum bufferOwner {
    unknown,
};

// White list audio/video roles to be tested.
static std::set<std::string> kWhiteListRoles{
// List known and thus tested audio/video roles.
static std::set<std::string> kKnownRoles{
        "audio_encoder.aac",      "audio_encoder.amrnb", "audio_encoder.amrwb",
        "audio_encoder.flac",     "audio_decoder.aac",   "audio_decoder.amrnb",
        "audio_decoder.amrwb",    "audio_decoder.flac",  "audio_decoder.g711alaw",
+2 −2
Original line number Diff line number Diff line
@@ -15,9 +15,9 @@
//

cc_test {
    name: "VtsHalMediaOmxV1_0TargetMasterTest",
    name: "VtsHalMediaOmxV1_0TargetStoreTest",
    defaults: ["VtsHalMediaOmxV1_0Defaults"],
    srcs: ["VtsHalMediaOmxV1_0TargetMasterTest.cpp"],
    srcs: ["VtsHalMediaOmxV1_0TargetStoreTest.cpp"],
    test_suites: [
        "general-tests",
        "vts",
+8 −8
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@
 * limitations under the License.
 */

#define LOG_TAG "media_omx_hidl_master_test"
#define LOG_TAG "media_omx_hidl_store_test"
#ifdef __LP64__
#define OMX_ANDROID_COMPILE_AS_32BIT_ON_64BIT_PLATFORMS
#endif
@@ -55,7 +55,7 @@ using ::android::hidl::memory::V1_0::IMemory;
#include <getopt.h>
#include <media_hidl_test_common.h>

class MasterHidlTest : public ::testing::TestWithParam<std::string> {
class StoreHidlTest : public ::testing::TestWithParam<std::string> {
  public:
    virtual void SetUp() override {
        omxStore = IOmxStore::getService(GetParam());
@@ -127,7 +127,7 @@ void validateAttributes(
}

// Make sure IOmx and IOmxStore have the same set of instances.
TEST(MasterHidlTest, instanceMatchValidation) {
TEST(StoreHidlTest, instanceMatchValidation) {
    auto omxInstances = android::hardware::getAllHalInstanceNames(IOmx::descriptor);
    auto omxStoreInstances = android::hardware::getAllHalInstanceNames(IOmxStore::descriptor);
    ASSERT_EQ(omxInstances.size(), omxInstances.size());
@@ -138,7 +138,7 @@ TEST(MasterHidlTest, instanceMatchValidation) {
}

// list service attributes and verify expected formats
TEST_P(MasterHidlTest, ListServiceAttr) {
TEST_P(StoreHidlTest, ListServiceAttr) {
    description("list service attributes");
    android::hardware::media::omx::V1_0::Status status;
    hidl_vec<IOmxStore::Attribute> attributes;
@@ -184,7 +184,7 @@ TEST_P(MasterHidlTest, ListServiceAttr) {
}

// get node prefix
TEST_P(MasterHidlTest, getNodePrefix) {
TEST_P(StoreHidlTest, getNodePrefix) {
    description("get node prefix");
    hidl_string prefix;
    omxStore->getNodePrefix(
@@ -193,7 +193,7 @@ TEST_P(MasterHidlTest, getNodePrefix) {
}

// list roles and validate all RoleInfo objects
TEST_P(MasterHidlTest, ListRoles) {
TEST_P(StoreHidlTest, ListRoles) {
    description("list roles");
    hidl_vec<IOmxStore::RoleInfo> roleList;
    omxStore->listRoles([&roleList](hidl_vec<IOmxStore::RoleInfo> const& _nl) {
@@ -370,7 +370,7 @@ TEST_P(MasterHidlTest, ListRoles) {
}

// list components and roles.
TEST_P(MasterHidlTest, ListNodes) {
TEST_P(StoreHidlTest, ListNodes) {
    description("enumerate component and roles");
    android::hardware::media::omx::V1_0::Status status;
    hidl_vec<IOmx::ComponentInfo> nodeList;
@@ -419,6 +419,6 @@ TEST_P(MasterHidlTest, ListNodes) {
}

INSTANTIATE_TEST_CASE_P(
        PerInstance, MasterHidlTest,
        PerInstance, StoreHidlTest,
        testing::ValuesIn(android::hardware::getAllHalInstanceNames(IOmxStore::descriptor)),
        android::hardware::PrintInstanceNameToString);
Loading