Fixed test and log formatting for CdmResponseType.
[ Merge of http://go/wvgerrit/168397 ] When CdmResponseType (enum) was transformed to CdmResponseType (struct), the test printers where not updated to print the result of failed comparisons. In addition, several logs statements were updated haphazardly, leaving inconsistencies and potential compiler-specific behavior. This CL replaces CdmResponseType std::string operator with a ToString() method. This is to make it consistent with Google's C++ style guide on conversion operators vs methods. The string conversion function is now defined in wv_cdm_types.cpp instead of inline in the header file. The PrintTo function has been implemented along with the other CDM test printers in test_printers.cpp. Bug: 273989359 Test: run_x86_64_tests Test: MediaDrmParameterizedTests on redfin Test: Forrest drm_compliance Change-Id: Ibfaa17029046b75b1c8c278f7bd7e04a24379848
This commit is contained in:
@@ -456,7 +456,7 @@ class WvCdmExtendedDurationTest : public WvCdmTestBase {
|
||||
void Provision() {
|
||||
CdmResponseType status = decryptor_->OpenSession(
|
||||
config_.key_system(), nullptr, kDefaultCdmIdentifier, nullptr, &session_id_);
|
||||
switch (status.Enum()) {
|
||||
switch (status.code()) {
|
||||
case NO_ERROR:
|
||||
decryptor_->CloseSession(session_id_);
|
||||
return;
|
||||
@@ -968,7 +968,7 @@ TEST_F(WvCdmExtendedDurationTest, DecryptionCloseSessionConcurrencyTest) {
|
||||
status = decryptor_->Decrypt(session_id_, (data + i)->validate_key_id,
|
||||
decryption_parameters);
|
||||
|
||||
switch (status.Enum()) {
|
||||
switch (status.code()) {
|
||||
case SESSION_NOT_FOUND_FOR_DECRYPT:
|
||||
case SESSION_NOT_FOUND_18:
|
||||
// Session was closed before decrypt was called. This is expected
|
||||
@@ -978,9 +978,7 @@ TEST_F(WvCdmExtendedDurationTest, DecryptionCloseSessionConcurrencyTest) {
|
||||
EXPECT_EQ((data + i)->decrypt_data, decrypt_buffer);
|
||||
break;
|
||||
default:
|
||||
// common_typos_disable
|
||||
EXPECT_TRUE(false) << " Unexpected decrypt result: " << status.Enum();
|
||||
// common_typos_enable
|
||||
ADD_FAILURE() << "Unexpected decrypt result: " << status.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2112,7 +2112,7 @@ class WvCdmRequestLicenseTest : public WvCdmTestBase {
|
||||
|
||||
decryptor_->CloseSession(session_id_);
|
||||
|
||||
switch (status.Enum()) {
|
||||
switch (status.code()) {
|
||||
case wvcdm::NO_ERROR:
|
||||
case KEY_MESSAGE:
|
||||
return true;
|
||||
@@ -2591,7 +2591,7 @@ TEST_F(WvCdmRequestLicenseTest, ProvisioningRevocationTest) {
|
||||
decryptor_->OpenSession(config_.key_system(), nullptr,
|
||||
kDefaultCdmIdentifier, nullptr, &session_id_);
|
||||
|
||||
switch (result.Enum()) {
|
||||
switch (result.code()) {
|
||||
case wvcdm::NO_ERROR:
|
||||
decryptor_->CloseSession(session_id_);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user