Merge "Support binderized and passthrough vendor services" into oc-dev

am: 25197f0f6f

Change-Id: Ia44472c4b20f1e3128d830665af23947c235cfed
This commit is contained in:
Jeff Tinker
2017-04-10 22:28:32 +00:00
committed by android-build-merger

View File

@@ -78,6 +78,7 @@ using std::vector;
using ContentConfiguration = ::DrmHalVTSVendorModule_V1::ContentConfiguration; using ContentConfiguration = ::DrmHalVTSVendorModule_V1::ContentConfiguration;
using Key = ::DrmHalVTSVendorModule_V1::ContentConfiguration::Key; using Key = ::DrmHalVTSVendorModule_V1::ContentConfiguration::Key;
using VtsTestBase = ::testing::VtsHalHidlTargetTestBase;
#define ASSERT_OK(ret) ASSERT_TRUE(ret.isOk()) #define ASSERT_OK(ret) ASSERT_TRUE(ret.isOk())
#define EXPECT_OK(ret) EXPECT_TRUE(ret.isOk()) #define EXPECT_OK(ret) EXPECT_TRUE(ret.isOk())
@@ -106,14 +107,22 @@ class DrmHalVendorFactoryTest : public testing::TestWithParam<std::string> {
GetParam().c_str()); GetParam().c_str());
ASSERT_NE(vendorModule, nullptr); ASSERT_NE(vendorModule, nullptr);
// First try the binderized service name provided by the vendor module.
// If that fails, which it can on non-binderized devices, try the default
// service.
string name = vendorModule->getServiceName(); string name = vendorModule->getServiceName();
drmFactory = drmFactory = VtsTestBase::getService<IDrmFactory>(name);
::testing::VtsHalHidlTargetTestBase::getService<IDrmFactory>( if (drmFactory == nullptr) {
name != "default" ? name : "drm"); drmFactory = VtsTestBase::getService<IDrmFactory>("drm");
}
ASSERT_NE(drmFactory, nullptr); ASSERT_NE(drmFactory, nullptr);
cryptoFactory =
::testing::VtsHalHidlTargetTestBase::getService<ICryptoFactory>( // Dot the same for the crypto factory
name != "default" ? name : "crypto"); cryptoFactory = VtsTestBase::getService<ICryptoFactory>(name);
if (cryptoFactory == nullptr) {
VtsTestBase::getService<ICryptoFactory>("crypto");
}
ASSERT_NE(cryptoFactory, nullptr); ASSERT_NE(cryptoFactory, nullptr);
} }