Android CDM: Restored secure stop tests.
[ Semi-revert of http://ag/20183443 ] [ Merge of http://go/wvgerrit/168898 ] These tests were removed from Android last quarter; however, they now need to be restored. These tests will be removed in Android V. To help with ambiguity around where the CDM is operating on a single or set of usage info messages, the variables have been renamed to propery indicate plurality. Bug: 263319220 Test: cdm_extended_duration_test Test: request_license_test Test: libwvdrmdrmplugin_hal_test Change-Id: I38b16dd5811069fafaeab5ffc19d0f8a8095f0cf
This commit is contained in:
@@ -84,8 +84,8 @@ using wvcdm::CdmProvisioningResponse;
|
||||
using wvcdm::CdmQueryMap;
|
||||
using wvcdm::CdmSecureStopId;
|
||||
using wvcdm::CdmSecurityLevel;
|
||||
using wvcdm::CdmUsageInfo;
|
||||
using wvcdm::CdmUsageInfoReleaseMessage;
|
||||
using wvcdm::CdmUsageReport;
|
||||
using wvcdm::CdmUsageReportList;
|
||||
using wvcdm::kDefaultCdmIdentifier;
|
||||
using wvcdm::KeyId;
|
||||
using wvcdm::RequestedSecurityLevel;
|
||||
@@ -672,73 +672,55 @@ Status WVDrmPlugin::unprovisionDevice() {
|
||||
::ndk::ScopedAStatus WVDrmPlugin::getSecureStop(
|
||||
const ::aidl::android::hardware::drm::SecureStopId& in_secureStopId,
|
||||
::aidl::android::hardware::drm::SecureStop* _aidl_return) {
|
||||
if (!in_secureStopId.secureStopId.size()) {
|
||||
*_aidl_return = SecureStop();
|
||||
*_aidl_return = SecureStop();
|
||||
if (in_secureStopId.secureStopId.empty()) {
|
||||
return toNdkScopedAStatus(Status::BAD_VALUE);
|
||||
}
|
||||
|
||||
vector<uint8_t> cdmStopVec;
|
||||
SecureStop secureStop;
|
||||
|
||||
CdmIdentifier identifier;
|
||||
auto status = mCdmIdentifierBuilder.getCdmIdentifier(&identifier);
|
||||
if (status != Status::OK) {
|
||||
*_aidl_return = SecureStop();
|
||||
return toNdkScopedAStatus(status);
|
||||
}
|
||||
|
||||
CdmUsageInfo cdmUsageInfo;
|
||||
CdmSecureStopId cdmSsId(in_secureStopId.secureStopId.begin(),
|
||||
in_secureStopId.secureStopId.end());
|
||||
const CdmSecureStopId cdmSsId(in_secureStopId.secureStopId.begin(),
|
||||
in_secureStopId.secureStopId.end());
|
||||
CdmUsageReport cdmUsageReport;
|
||||
CdmResponseType res = mCDM->GetUsageInfo(mPropertySet.app_id(), cdmSsId,
|
||||
identifier, &cdmUsageInfo);
|
||||
identifier, &cdmUsageReport);
|
||||
|
||||
SecureStop secureStop;
|
||||
if (isCdmResponseTypeSuccess(res)) {
|
||||
for (CdmUsageInfo::const_iterator iter = cdmUsageInfo.begin();
|
||||
iter != cdmUsageInfo.end(); ++iter) {
|
||||
const std::string& cdmStop = *iter;
|
||||
cdmStopVec = StrToVector(cdmStop);
|
||||
}
|
||||
secureStop.opaqueData = cdmStopVec;
|
||||
secureStop.opaqueData = StrToVector(cdmUsageReport);
|
||||
*_aidl_return = std::move(secureStop);
|
||||
}
|
||||
|
||||
*_aidl_return = secureStop;
|
||||
return toNdkScopedAStatus(mapCdmResponseType(res));
|
||||
}
|
||||
|
||||
::ndk::ScopedAStatus WVDrmPlugin::getSecureStops(
|
||||
vector<::aidl::android::hardware::drm::SecureStop>* _aidl_return) {
|
||||
std::list<vector<uint8_t>> secureStops;
|
||||
vector<SecureStop> secureStopsVec;
|
||||
|
||||
_aidl_return->clear();
|
||||
CdmIdentifier identifier;
|
||||
auto status = mCdmIdentifierBuilder.getCdmIdentifier(&identifier);
|
||||
if (status != Status::OK) {
|
||||
*_aidl_return = secureStopsVec;
|
||||
return toNdkScopedAStatus(status);
|
||||
}
|
||||
|
||||
CdmUsageInfo cdmUsageInfo;
|
||||
CdmResponseType res =
|
||||
mCDM->GetUsageInfo(mPropertySet.app_id(), identifier, &cdmUsageInfo);
|
||||
CdmUsageReportList cdmUsageReports;
|
||||
const CdmResponseType res =
|
||||
mCDM->GetUsageInfo(mPropertySet.app_id(), identifier, &cdmUsageReports);
|
||||
|
||||
vector<SecureStop> secureStops;
|
||||
if (isCdmResponseTypeSuccess(res)) {
|
||||
secureStops.clear();
|
||||
for (CdmUsageInfo::const_iterator iter = cdmUsageInfo.begin();
|
||||
iter != cdmUsageInfo.end(); ++iter) {
|
||||
const std::string& cdmStop = *iter;
|
||||
secureStops.push_back(StrToVector(cdmStop));
|
||||
for (const CdmUsageReport& cdmUsageReport : cdmUsageReports) {
|
||||
SecureStop secureStop;
|
||||
secureStop.opaqueData = StrToVector(cdmUsageReport);
|
||||
secureStops.push_back(std::move(secureStop));
|
||||
}
|
||||
}
|
||||
*_aidl_return = std::move(secureStops);
|
||||
|
||||
std::list<vector<uint8_t>>::iterator iter = secureStops.begin();
|
||||
while (iter != secureStops.end()) {
|
||||
SecureStop secureStop;
|
||||
secureStop.opaqueData = *iter++;
|
||||
secureStopsVec.push_back(secureStop);
|
||||
}
|
||||
|
||||
*_aidl_return = secureStopsVec;
|
||||
return toNdkScopedAStatus(mapCdmResponseType(res));
|
||||
}
|
||||
|
||||
@@ -763,8 +745,8 @@ Status WVDrmPlugin::unprovisionDevice() {
|
||||
return toNdkScopedAStatus(status);
|
||||
}
|
||||
|
||||
CdmUsageInfoReleaseMessage cdmMessage(in_secureStopId.secureStopId.begin(),
|
||||
in_secureStopId.secureStopId.end());
|
||||
const CdmKeyResponse cdmMessage(in_secureStopId.secureStopId.begin(),
|
||||
in_secureStopId.secureStopId.end());
|
||||
CdmResponseType res = mCDM->ReleaseUsageInfo(cdmMessage, identifier);
|
||||
return toNdkScopedAStatus(mapCdmResponseType(res));
|
||||
}
|
||||
@@ -832,9 +814,10 @@ Status WVDrmPlugin::unprovisionDevice() {
|
||||
return toNdkScopedAStatus(status);
|
||||
}
|
||||
|
||||
const vector<uint8_t> data = in_ssRelease.opaqueData;
|
||||
CdmUsageInfoReleaseMessage cdmMessage(data.begin(), data.end());
|
||||
CdmResponseType res = mCDM->ReleaseUsageInfo(cdmMessage, identifier);
|
||||
const vector<uint8_t>& data = in_ssRelease.opaqueData;
|
||||
const CdmKeyResponse cdmMessage(data.begin(), data.end());
|
||||
// Only releases a single secure stop.
|
||||
const CdmResponseType res = mCDM->ReleaseUsageInfo(cdmMessage, identifier);
|
||||
return toNdkScopedAStatus(mapCdmResponseType(res));
|
||||
}
|
||||
|
||||
@@ -850,10 +833,10 @@ Status WVDrmPlugin::unprovisionDevice() {
|
||||
return toNdkScopedAStatus(status);
|
||||
}
|
||||
|
||||
CdmSecureStopId id(in_secureStopId.secureStopId.begin(),
|
||||
in_secureStopId.secureStopId.end());
|
||||
CdmResponseType res =
|
||||
mCDM->RemoveUsageInfo(mPropertySet.app_id(), identifier, id);
|
||||
const CdmSecureStopId ssid(in_secureStopId.secureStopId.begin(),
|
||||
in_secureStopId.secureStopId.end());
|
||||
const CdmResponseType res =
|
||||
mCDM->RemoveUsageInfo(mPropertySet.app_id(), identifier, ssid);
|
||||
return toNdkScopedAStatus(mapCdmResponseType(res));
|
||||
}
|
||||
|
||||
@@ -864,7 +847,7 @@ Status WVDrmPlugin::unprovisionDevice() {
|
||||
return toNdkScopedAStatus(status);
|
||||
}
|
||||
|
||||
CdmResponseType res =
|
||||
const CdmResponseType res =
|
||||
mCDM->RemoveAllUsageInfo(mPropertySet.app_id(), identifier);
|
||||
return toNdkScopedAStatus(mapCdmResponseType(res));
|
||||
}
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
//
|
||||
// #define LOG_NDEBUG 0
|
||||
#define LOG_TAG "WVDrmPluginHalTest"
|
||||
#include "WVDrmPlugin.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <utils/Log.h>
|
||||
|
||||
@@ -15,16 +13,18 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "WVDrmPlugin.h"
|
||||
#include "WVErrors.h"
|
||||
#include "cdm_client_property_set.h"
|
||||
#include "cdm_random.h"
|
||||
#include "gmock/gmock.h"
|
||||
#include "gtest/gtest.h"
|
||||
#include "media/stagefright/MediaErrors.h"
|
||||
#include "media/stagefright/foundation/ABase.h"
|
||||
#include "string_conversions.h"
|
||||
#include "wv_cdm_constants.h"
|
||||
#include "wv_cdm_types.h"
|
||||
#include "wv_content_decryption_module.h"
|
||||
#include "gmock/gmock.h"
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
namespace {
|
||||
typedef std::vector<::aidl::android::hardware::drm::KeyValue> KeyedVector;
|
||||
@@ -47,6 +47,8 @@ using ::aidl::android::hardware::drm::KeyValue;
|
||||
using ::aidl::android::hardware::drm::OfflineLicenseState;
|
||||
using ::aidl::android::hardware::drm::ProvideProvisionResponseResult;
|
||||
using ::aidl::android::hardware::drm::ProvisionRequest;
|
||||
using ::aidl::android::hardware::drm::SecureStop;
|
||||
using ::aidl::android::hardware::drm::SecureStopId;
|
||||
using ::aidl::android::hardware::drm::SecurityLevel;
|
||||
using ::aidl::android::hardware::drm::Status;
|
||||
|
||||
@@ -54,6 +56,7 @@ using ::testing::_;
|
||||
using ::testing::AllOf;
|
||||
using ::testing::Args;
|
||||
using ::testing::AtLeast;
|
||||
using ::testing::Contains;
|
||||
using ::testing::DefaultValue;
|
||||
using ::testing::DoAll;
|
||||
using ::testing::ElementsAreArray;
|
||||
@@ -89,7 +92,10 @@ using wvcdm::CdmOfflineLicenseState;
|
||||
using wvcdm::CdmProvisioningRequest;
|
||||
using wvcdm::CdmProvisioningResponse;
|
||||
using wvcdm::CdmQueryMap;
|
||||
using wvcdm::CdmSecureStopId;
|
||||
using wvcdm::CdmSecurityLevel;
|
||||
using wvcdm::CdmUsageReport;
|
||||
using wvcdm::CdmUsageReportList;
|
||||
using wvcdm::EMPTY_ORIGIN;
|
||||
using wvcdm::kCertificateWidevine;
|
||||
using wvcdm::KEY_ID_SIZE;
|
||||
@@ -133,6 +139,7 @@ using wvcdm::QUERY_VALUE_SECURITY_LEVEL_L3;
|
||||
using wvcdm::SESSION_ID_PREFIX;
|
||||
using wvcdm::WvCdmEventListener;
|
||||
using wvutil::Base64Encode;
|
||||
using wvutil::CdmRandom;
|
||||
|
||||
namespace {
|
||||
const std::string kEmptyString;
|
||||
@@ -157,93 +164,107 @@ const char kSerializedMetricsHex[] =
|
||||
"0";
|
||||
|
||||
#define N_ELEM(a) (sizeof(a) / sizeof(a[0]))
|
||||
} // anonymous namespace
|
||||
|
||||
class MockCDM : public WvContentDecryptionModule {
|
||||
public:
|
||||
MOCK_METHOD(CdmResponseType, OpenSession,
|
||||
(const CdmKeySystem &, CdmClientPropertySet *,
|
||||
const CdmIdentifier &, WvCdmEventListener *, CdmSessionId *),
|
||||
(override));
|
||||
public:
|
||||
virtual ~MockCDM() {}
|
||||
|
||||
MOCK_METHOD(CdmResponseType, CloseSession, (const CdmSessionId &),
|
||||
(override));
|
||||
MOCK_METHOD(CdmResponseType, OpenSession,
|
||||
(const CdmKeySystem &, CdmClientPropertySet *,
|
||||
const CdmIdentifier &, WvCdmEventListener *, CdmSessionId *),
|
||||
(override));
|
||||
|
||||
MOCK_METHOD(CdmResponseType, GenerateKeyRequest,
|
||||
(const CdmSessionId &, const CdmKeySetId &, const std::string &,
|
||||
const CdmInitData &, const CdmLicenseType, CdmAppParameterMap &,
|
||||
CdmClientPropertySet *, const CdmIdentifier &, CdmKeyRequest *),
|
||||
(override));
|
||||
MOCK_METHOD(CdmResponseType, CloseSession, (const CdmSessionId &), (override));
|
||||
|
||||
MOCK_METHOD(CdmResponseType, AddKey,
|
||||
(const CdmSessionId &, const CdmKeyResponse &, CdmKeySetId *),
|
||||
(override));
|
||||
MOCK_METHOD(CdmResponseType, GenerateKeyRequest,
|
||||
(const CdmSessionId &, const CdmKeySetId &, const std::string &,
|
||||
const CdmInitData &, const CdmLicenseType, CdmAppParameterMap &,
|
||||
CdmClientPropertySet *, const CdmIdentifier &, CdmKeyRequest *),
|
||||
(override));
|
||||
|
||||
MOCK_METHOD(CdmResponseType, RemoveKeys, (const CdmSessionId &), (override));
|
||||
MOCK_METHOD(CdmResponseType, AddKey,
|
||||
(const CdmSessionId &, const CdmKeyResponse &, CdmKeySetId *),
|
||||
(override));
|
||||
|
||||
MOCK_METHOD(CdmResponseType, RestoreKey,
|
||||
(const CdmSessionId &, const CdmKeySetId &), (override));
|
||||
MOCK_METHOD(CdmResponseType, RemoveKeys, (const CdmSessionId &), (override));
|
||||
|
||||
MOCK_METHOD(CdmResponseType, QueryStatus,
|
||||
(wvcdm::RequestedSecurityLevel, const std::string &,
|
||||
std::string *),
|
||||
(override));
|
||||
MOCK_METHOD(CdmResponseType, RestoreKey,
|
||||
(const CdmSessionId &, const CdmKeySetId &), (override));
|
||||
|
||||
MOCK_METHOD(CdmResponseType, QuerySessionStatus,
|
||||
(const CdmSessionId &, CdmQueryMap *), (override));
|
||||
MOCK_METHOD(CdmResponseType, QueryStatus,
|
||||
(wvcdm::RequestedSecurityLevel, const std::string &,
|
||||
std::string *),
|
||||
(override));
|
||||
|
||||
MOCK_METHOD(CdmResponseType, QueryKeyStatus,
|
||||
(const CdmSessionId &, CdmQueryMap *), (override));
|
||||
MOCK_METHOD(CdmResponseType, QuerySessionStatus,
|
||||
(const CdmSessionId &, CdmQueryMap *), (override));
|
||||
|
||||
MOCK_METHOD(CdmResponseType, QueryOemCryptoSessionId,
|
||||
(const CdmSessionId &, CdmQueryMap *), (override));
|
||||
MOCK_METHOD(CdmResponseType, QueryKeyStatus,
|
||||
(const CdmSessionId &, CdmQueryMap *), (override));
|
||||
|
||||
MOCK_METHOD(CdmResponseType, GetProvisioningRequest,
|
||||
(CdmCertificateType, const std::string &, const CdmIdentifier &,
|
||||
const std::string &, wvcdm::RequestedSecurityLevel,
|
||||
CdmProvisioningRequest *, std::string *),
|
||||
(override));
|
||||
MOCK_METHOD(CdmResponseType, QueryOemCryptoSessionId,
|
||||
(const CdmSessionId &, CdmQueryMap *), (override));
|
||||
|
||||
MOCK_METHOD(CdmResponseType, HandleProvisioningResponse,
|
||||
(const CdmIdentifier &, const CdmProvisioningResponse &,
|
||||
wvcdm::RequestedSecurityLevel, std::string *, std::string *),
|
||||
(override));
|
||||
MOCK_METHOD(CdmResponseType, GetProvisioningRequest,
|
||||
(CdmCertificateType, const std::string &, const CdmIdentifier &,
|
||||
const std::string &, wvcdm::RequestedSecurityLevel,
|
||||
CdmProvisioningRequest *, std::string *),
|
||||
(override));
|
||||
|
||||
MOCK_METHOD(CdmResponseType, Unprovision,
|
||||
(CdmSecurityLevel, const CdmIdentifier &), (override));
|
||||
MOCK_METHOD(CdmResponseType, HandleProvisioningResponse,
|
||||
(const CdmIdentifier &, const CdmProvisioningResponse &,
|
||||
wvcdm::RequestedSecurityLevel, std::string *, std::string *),
|
||||
(override));
|
||||
|
||||
MOCK_METHOD(bool, IsProvisioned,
|
||||
(CdmSecurityLevel, const std::string &, const std::string &,
|
||||
bool),
|
||||
(override));
|
||||
MOCK_METHOD(CdmResponseType, Unprovision,
|
||||
(CdmSecurityLevel, const CdmIdentifier &), (override));
|
||||
|
||||
MOCK_METHOD(bool, IsValidServiceCertificate, (const std::string &),
|
||||
(override));
|
||||
MOCK_METHOD(bool, IsProvisioned,
|
||||
(CdmSecurityLevel, const std::string &, const std::string &, bool),
|
||||
(override));
|
||||
|
||||
MOCK_METHOD(CdmResponseType, GetMetrics,
|
||||
(const CdmIdentifier &, drm_metrics::WvCdmMetrics *), (override));
|
||||
MOCK_METHOD(CdmResponseType, GetUsageInfo,
|
||||
(const std::string &, const CdmIdentifier &, CdmUsageReportList *),
|
||||
(override));
|
||||
|
||||
MOCK_METHOD(CdmResponseType, GetDecryptHashError,
|
||||
(const CdmSessionId &, std::string *), (override));
|
||||
MOCK_METHOD(CdmResponseType, GetUsageInfo,
|
||||
(const std::string &, const CdmSecureStopId &,
|
||||
const CdmIdentifier &, CdmUsageReport *),
|
||||
(override));
|
||||
|
||||
MOCK_METHOD(CdmResponseType, ListStoredLicenses,
|
||||
(CdmSecurityLevel, const CdmIdentifier &,
|
||||
std::vector<std::string> *),
|
||||
(override));
|
||||
MOCK_METHOD(CdmResponseType, RemoveAllUsageInfo,
|
||||
(const std::string &, const CdmIdentifier &), (override));
|
||||
|
||||
MOCK_METHOD(CdmResponseType, GetOfflineLicenseState,
|
||||
(const std::string &, CdmSecurityLevel, const CdmIdentifier &,
|
||||
CdmOfflineLicenseState *),
|
||||
(override));
|
||||
MOCK_METHOD(CdmResponseType, ReleaseUsageInfo,
|
||||
(const CdmKeyResponse &, const CdmIdentifier &), (override));
|
||||
|
||||
MOCK_METHOD(CdmResponseType, RemoveOfflineLicense,
|
||||
(const std::string &, CdmSecurityLevel, const CdmIdentifier &),
|
||||
(override));
|
||||
MOCK_METHOD(bool, IsValidServiceCertificate, (const std::string &),
|
||||
(override));
|
||||
|
||||
MOCK_METHOD(CdmResponseType, StoreAtscLicense,
|
||||
(const CdmIdentifier &, wvcdm::RequestedSecurityLevel,
|
||||
const std::string &, const std::string &),
|
||||
(override));
|
||||
MOCK_METHOD(CdmResponseType, GetMetrics,
|
||||
(const CdmIdentifier &, drm_metrics::WvCdmMetrics *), (override));
|
||||
|
||||
MOCK_METHOD(CdmResponseType, GetDecryptHashError,
|
||||
(const CdmSessionId &, std::string *), (override));
|
||||
|
||||
MOCK_METHOD(CdmResponseType, ListStoredLicenses,
|
||||
(CdmSecurityLevel, const CdmIdentifier &,
|
||||
std::vector<std::string> *),
|
||||
(override));
|
||||
|
||||
MOCK_METHOD(CdmResponseType, GetOfflineLicenseState,
|
||||
(const std::string &, CdmSecurityLevel, const CdmIdentifier &,
|
||||
CdmOfflineLicenseState *),
|
||||
(override));
|
||||
|
||||
MOCK_METHOD(CdmResponseType, RemoveOfflineLicense,
|
||||
(const std::string &, CdmSecurityLevel, const CdmIdentifier &),
|
||||
(override));
|
||||
|
||||
MOCK_METHOD(CdmResponseType, StoreAtscLicense,
|
||||
(const CdmIdentifier &, wvcdm::RequestedSecurityLevel,
|
||||
const std::string &, const std::string &),
|
||||
(override));
|
||||
};
|
||||
|
||||
class MockCrypto : public WVGenericCryptoInterface {
|
||||
@@ -280,6 +301,8 @@ public:
|
||||
(override));
|
||||
};
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
template <uint8_t DIGIT>
|
||||
CdmResponseType setSessionIdOnMap(testing::Unused, CdmQueryMap *map) {
|
||||
static const char oecId[] = {DIGIT + '0', '\0'};
|
||||
@@ -968,6 +991,62 @@ TEST_F(WVDrmPluginHalTest, RejectsAtscUnprovisionDeviceRequests) {
|
||||
ASSERT_EQ(Status::ERROR_DRM_CANNOT_HANDLE, status);
|
||||
}
|
||||
|
||||
TEST_F(WVDrmPluginHalTest, GetsSecureStops) {
|
||||
static constexpr uint32_t kStopSize = 53;
|
||||
static constexpr uint32_t kStopCount = 7;
|
||||
|
||||
CdmUsageReportList fakeSecureStops;
|
||||
for (uint32_t i = 0; i < kStopCount; ++i) {
|
||||
fakeSecureStops.push_back(CdmRandom::RandomData(kStopSize));
|
||||
}
|
||||
|
||||
const std::string app_id = "my_app_id";
|
||||
EXPECT_CALL(*mCdm, GetUsageInfo(app_id, _, _))
|
||||
.WillOnce(DoAll(SetArgPointee<2>(fakeSecureStops),
|
||||
testing::Return(CdmResponseType(wvcdm::NO_ERROR))));
|
||||
|
||||
auto ret = mPlugin->setPropertyString("appId", app_id);
|
||||
EXPECT_TRUE(ret.isOk());
|
||||
|
||||
std::vector<SecureStop> secureStops;
|
||||
ret = mPlugin->getSecureStops(&secureStops);
|
||||
EXPECT_TRUE(ret.isOk());
|
||||
|
||||
CdmUsageReportList stops;
|
||||
for (const auto &stop : secureStops) {
|
||||
stops.emplace_back(stop.opaqueData.begin(), stop.opaqueData.end());
|
||||
}
|
||||
|
||||
EXPECT_EQ(kStopCount, stops.size());
|
||||
|
||||
for (const CdmUsageReport &expectedSecureStop : fakeSecureStops) {
|
||||
EXPECT_THAT(stops, Contains(expectedSecureStop));
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(WVDrmPluginHalTest, ReleasesAllSecureStops) {
|
||||
const std::string app_id = "";
|
||||
EXPECT_CALL(*mCdm, RemoveAllUsageInfo(app_id, _)).Times(1);
|
||||
|
||||
auto ret = mPlugin->setPropertyString("appId", app_id);
|
||||
EXPECT_TRUE(ret.isOk());
|
||||
|
||||
ret = mPlugin->releaseAllSecureStops();
|
||||
EXPECT_TRUE(ret.isOk());
|
||||
}
|
||||
|
||||
TEST_F(WVDrmPluginHalTest, ReleasesSecureStop) {
|
||||
static constexpr uint32_t kMessageSize = 128;
|
||||
const CdmKeyResponse releaseMessage = CdmRandom::RandomData(kMessageSize);
|
||||
|
||||
EXPECT_CALL(*mCdm, ReleaseUsageInfo(releaseMessage, _)).Times(1);
|
||||
|
||||
SecureStopId stopId;
|
||||
stopId.secureStopId.assign(releaseMessage.begin(), releaseMessage.end());
|
||||
auto ret = mPlugin->releaseSecureStop(stopId);
|
||||
EXPECT_TRUE(ret.isOk());
|
||||
}
|
||||
|
||||
TEST_F(WVDrmPluginHalTest, ReturnsExpectedPropertyValues) {
|
||||
CdmQueryMap l1Map;
|
||||
l1Map[QUERY_KEY_SECURITY_LEVEL] = QUERY_VALUE_SECURITY_LEVEL_L1;
|
||||
|
||||
Reference in New Issue
Block a user