Fix CanSetServiceCertificate Test
(This is a merge of http://go/wvgerrit/14783) When validation was added to the service certificate property, it broke the associated test, which sends random data. It also did not do any testing of the new validation itself. This fix makes the validation method on WvContentDecryptionModule non-static so that it can be mocked and handled appropriately in the test. Bug: 21923281 Change-Id: Id5d2315709fce35f9347b3545f594371810349f0
This commit is contained in:
@@ -585,8 +585,7 @@ status_t WVDrmPlugin::setPropertyByteArray(const String8& name,
|
||||
const Vector<uint8_t>& value) {
|
||||
if (name == "serviceCertificate") {
|
||||
std::string cert(value.begin(), value.end());
|
||||
if (value.isEmpty() ||
|
||||
WvContentDecryptionModule::IsValidServiceCertificate(cert)) {
|
||||
if (value.isEmpty() || mCDM->IsValidServiceCertificate(cert)) {
|
||||
mPropertySet.set_service_certificate(cert);
|
||||
} else {
|
||||
return android::BAD_VALUE;
|
||||
|
||||
Reference in New Issue
Block a user