Add more CdmResponseType to help with debugging in the field.

The errors in the range ERROR_DRM_VENDOR_MIN to ERROR_DRM_VENDOR_MAX are
reflected in the message that is reported to the app, which is
MediaDrmStateException.getDiagnosticInfo().

Many errors map to kErrorCDMGeneric, especially KEY_ERROR is used as a
generic error in CDM. This fix defines more specific error codes in the
CDM for places where KEY_ERROR is returned.

Merge from http://go/wvgerrit/14071

bug: 19244061
Change-Id: I688bf32828f997000fea041dd29567dde18ac677
This commit is contained in:
Edwin Wong
2015-04-15 11:44:06 -07:00
parent c5f576585b
commit 2eb013691c
11 changed files with 974 additions and 177 deletions

View File

@@ -790,7 +790,7 @@ TEST_F(WvCdmRequestLicenseTest, ProvisioningRetryTest) {
response =
GetCertRequestResponse(g_config->provisioning_server_url());
EXPECT_NE(0, static_cast<int>(response.size()));
EXPECT_EQ(wvcdm::UNKNOWN_ERROR,
EXPECT_EQ(wvcdm::EMPTY_PROVISIONING_CERTIFICATE,
decryptor_.HandleProvisioningResponse(EMPTY_ORIGIN, response, &cert,
&wrapped_key));
EXPECT_EQ(0, static_cast<int>(cert.size()));
@@ -1095,7 +1095,8 @@ TEST_F(WvCdmRequestLicenseTest, ReleaseRetryOfflineKeyTest) {
session_id_.clear();
decryptor_.OpenSession(g_key_system, NULL, EMPTY_ORIGIN, NULL, &session_id_);
EXPECT_EQ(wvcdm::UNKNOWN_ERROR, decryptor_.RestoreKey(session_id_, key_set_id));
EXPECT_EQ(wvcdm::GET_RELEASED_LICENSE_ERROR,
decryptor_.RestoreKey(session_id_, key_set_id));
decryptor_.CloseSession(session_id_);
session_id_.clear();
@@ -1164,8 +1165,8 @@ TEST_F(WvCdmRequestLicenseTest, ReleaseRetryL3OfflineKeyTest) {
session_id_.clear();
decryptor_.OpenSession(g_key_system, &property_set, EMPTY_ORIGIN, NULL,
&session_id_);
EXPECT_EQ(
wvcdm::UNKNOWN_ERROR, decryptor_.RestoreKey(session_id_, key_set_id));
EXPECT_EQ(wvcdm::GET_RELEASED_LICENSE_ERROR,
decryptor_.RestoreKey(session_id_, key_set_id));
decryptor_.CloseSession(session_id_);
session_id_.clear();