From d1b6beb164b0f2cb5016599df148365001187456 Mon Sep 17 00:00:00 2001 From: Robert Shih Date: Fri, 6 Jan 2023 22:23:55 -0800 Subject: [PATCH] drm aidl vts: proper skip tests without vendor module Bug: 253168737 Test: VtsAidlHalDrmTargetTest Change-Id: Iaac3ef19197dceea16061e9926c831818b27bd14 --- drm/aidl/vts/drm_hal_common.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drm/aidl/vts/drm_hal_common.cpp b/drm/aidl/vts/drm_hal_common.cpp index 7de81670ab..f5ef0e7da8 100644 --- a/drm/aidl/vts/drm_hal_common.cpp +++ b/drm/aidl/vts/drm_hal_common.cpp @@ -187,6 +187,12 @@ void DrmHalTest::SetUp() { auto svc = GetParamService(); const string drmInstance = HalFullName(kDrmIface, svc); + if (!vendorModule) { + ASSERT_NE(drmInstance, HalFullName(kDrmIface, "widevine")) << "Widevine requires vendor module."; + ASSERT_NE(drmInstance, HalFullName(kDrmIface, "clearkey")) << "Clearkey requires vendor module."; + GTEST_SKIP() << "No vendor module installed"; + } + if (drmInstance.find("IDrmFactory") != std::string::npos) { drmFactory = IDrmFactory::fromBinder( ::ndk::SpAIBinder(AServiceManager_waitForService(drmInstance.c_str()))); @@ -195,12 +201,6 @@ void DrmHalTest::SetUp() { cryptoPlugin = createCryptoPlugin(); } - if (!vendorModule) { - ASSERT_NE(drmInstance, "widevine") << "Widevine requires vendor module."; - ASSERT_NE(drmInstance, "clearkey") << "Clearkey requires vendor module."; - GTEST_SKIP() << "No vendor module installed"; - } - ASSERT_EQ(HalBaseName(drmInstance), vendorModule->getServiceName()); contentConfigurations = vendorModule->getContentConfigurations();