Address compilation warnings

[ Merge of http://go/wvgerrit/90350 ]

Bug: 145244554
Test: wv android unit/integration tests
Change-Id: I5cd8a132836ce097a7b539fffdcef574f64cbdcf
This commit is contained in:
Rahul Frias
2019-11-26 16:47:41 -08:00
parent 176096a2d3
commit b8a6035298
5 changed files with 56 additions and 58 deletions

View File

@@ -260,7 +260,7 @@ void WvCdmTestBase::InstallTestRootOfTrust() {
} }
} }
void WvCdmTestBase::Provision(size_t max_attempts) { void WvCdmTestBase::Provision() {
CdmProvisioningRequest prov_request; CdmProvisioningRequest prov_request;
CdmProvisioningRequest binary_prov_request; CdmProvisioningRequest binary_prov_request;
std::string provisioning_server_url; std::string provisioning_server_url;
@@ -271,8 +271,6 @@ void WvCdmTestBase::Provision(size_t max_attempts) {
CdmSessionId session_id; CdmSessionId session_id;
FileSystem file_system; FileSystem file_system;
ASSERT_GE(max_attempts, 1lu) << "|max_attempts| must be at least 1";
// TODO(fredgc): provision for different SPOIDs. // TODO(fredgc): provision for different SPOIDs.
CdmEngine cdm_engine(&file_system, CdmEngine cdm_engine(&file_system,
std::shared_ptr<EngineMetrics>(new EngineMetrics)); std::shared_ptr<EngineMetrics>(new EngineMetrics));
@@ -294,8 +292,6 @@ void WvCdmTestBase::Provision(size_t max_attempts) {
// for test vs. production server. // for test vs. production server.
provisioning_server_url.assign(config_.provisioning_server()); provisioning_server_url.assign(config_.provisioning_server());
// Attempt to provision using the same requests a maximum of |max_attempts|
// times.
// TODO(b/139361531): Remove loop once provisioning service is stable. // TODO(b/139361531): Remove loop once provisioning service is stable.
std::string http_message; std::string http_message;
size_t attempt_num = 0; size_t attempt_num = 0;
@@ -363,7 +359,8 @@ void WvCdmTestBase::Provision(size_t max_attempts) {
} }
} }
provision_success = true; provision_success = true;
} while (attempt_num <= max_attempts && !provision_success); } while (attempt_num <= kDefaultMaxProvisioningAttempts &&
!provision_success);
if (attempt_num > 1) { if (attempt_num > 1) {
LOGW("Provisioning request failed at least once: attempts = %zu", LOGW("Provisioning request failed at least once: attempts = %zu",

View File

@@ -35,7 +35,7 @@ class WvCdmTestBase : public ::testing::Test {
static void InstallTestRootOfTrust(); static void InstallTestRootOfTrust();
// Send provisioning request to the server and handle response. // Send provisioning request to the server and handle response.
virtual void Provision(size_t max_attempts = kDefaultMaxProvisioningAttempts); virtual void Provision();
// Calls Provision() if not already provisioned. // Calls Provision() if not already provisioned.
virtual void EnsureProvisioned(); virtual void EnsureProvisioned();

View File

@@ -2004,9 +2004,7 @@ class WvCdmRequestLicenseTest : public WvCdmTestBase {
decryptor_->Unprovision(kSecurityLevelL3, kDefaultCdmIdentifier)); decryptor_->Unprovision(kSecurityLevelL3, kDefaultCdmIdentifier));
} }
void Provision(SecurityLevel level) { void Provision() { Provision(kDefaultCdmIdentifier, kLevelDefault); }
Provision(kDefaultCdmIdentifier, level);
}
void Provision(const CdmIdentifier& identifier, SecurityLevel level, void Provision(const CdmIdentifier& identifier, SecurityLevel level,
CdmProvisioningResponse* provisioning_response = nullptr) { CdmProvisioningResponse* provisioning_response = nullptr) {
@@ -2494,7 +2492,7 @@ TEST_F(WvCdmRequestLicenseTest, PropertySetTest) {
CdmSessionId session_id_Ln; CdmSessionId session_id_Ln;
Unprovision(); Unprovision();
Provision(kLevelDefault); Provision();
property_set_L1.set_security_level(QUERY_VALUE_SECURITY_LEVEL_L1); property_set_L1.set_security_level(QUERY_VALUE_SECURITY_LEVEL_L1);
property_set_L1.set_use_privacy_mode(true); property_set_L1.set_use_privacy_mode(true);
@@ -2659,7 +2657,7 @@ TEST_F(WvCdmRequestLicenseTest, AddStreamingKeyTest) {
TEST_F(WvCdmRequestLicenseTest, AddKeyOfflineTest) { TEST_F(WvCdmRequestLicenseTest, AddKeyOfflineTest) {
Unprovision(); Unprovision();
Provision(kLevelDefault); Provision();
// override default settings unless configured through the command line // override default settings unless configured through the command line
std::string key_id; std::string key_id;
@@ -2675,7 +2673,7 @@ TEST_F(WvCdmRequestLicenseTest, AddKeyOfflineTest) {
TEST_F(WvCdmRequestLicenseTest, RestoreOfflineKeyTest) { TEST_F(WvCdmRequestLicenseTest, RestoreOfflineKeyTest) {
Unprovision(); Unprovision();
Provision(kLevelDefault); Provision();
// override default settings unless configured through the command line // override default settings unless configured through the command line
std::string key_id; std::string key_id;
@@ -2700,7 +2698,7 @@ TEST_F(WvCdmRequestLicenseTest, RestoreOfflineKeyTest) {
TEST_F(WvCdmRequestLicenseTest, ReleaseOfflineKeyTest) { TEST_F(WvCdmRequestLicenseTest, ReleaseOfflineKeyTest) {
Unprovision(); Unprovision();
Provision(kLevelDefault); Provision();
// override default settings unless configured through the command line // override default settings unless configured through the command line
std::string key_id; std::string key_id;
@@ -2732,7 +2730,7 @@ TEST_F(WvCdmRequestLicenseTest, ReleaseOfflineKeyTest) {
TEST_F(WvCdmRequestLicenseTest, ReleaseOfflineKeySessionUsageDisabledTest) { TEST_F(WvCdmRequestLicenseTest, ReleaseOfflineKeySessionUsageDisabledTest) {
Unprovision(); Unprovision();
Provision(kLevelDefault); Provision();
// The default offline asset "offline_clip2" has the session usage table // The default offline asset "offline_clip2" has the session usage table
// entry enabled in the replay control portion of the key control block. // entry enabled in the replay control portion of the key control block.
@@ -2791,7 +2789,7 @@ TEST_F(WvCdmRequestLicenseTest, ReleaseOfflineKeySessionUsageDisabledTest) {
TEST_F(WvCdmRequestLicenseTest, ReleaseRetryOfflineKeyTest) { TEST_F(WvCdmRequestLicenseTest, ReleaseRetryOfflineKeyTest) {
Unprovision(); Unprovision();
Provision(kLevelDefault); Provision();
// override default settings unless configured through the command line // override default settings unless configured through the command line
std::string key_id; std::string key_id;
@@ -2984,7 +2982,7 @@ TEST_F(WvCdmRequestLicenseTest,
// deallocated (rather than leaked) and a new one allocated. // deallocated (rather than leaked) and a new one allocated.
TEST_F(WvCdmRequestLicenseTest, AutomatedOfflineSessionReleaseTest) { TEST_F(WvCdmRequestLicenseTest, AutomatedOfflineSessionReleaseTest) {
Unprovision(); Unprovision();
Provision(kLevelDefault); Provision();
// override default settings unless configured through the command line // override default settings unless configured through the command line
std::string key_id; std::string key_id;
@@ -3073,7 +3071,7 @@ TEST_F(WvCdmRequestLicenseTest, StreamingLicenseRenewalProhibited) {
TEST_F(WvCdmRequestLicenseTest, OfflineLicenseRenewal) { TEST_F(WvCdmRequestLicenseTest, OfflineLicenseRenewal) {
Unprovision(); Unprovision();
Provision(kLevelDefault); Provision();
// override default settings unless configured through the command line // override default settings unless configured through the command line
std::string key_id; std::string key_id;
@@ -3094,7 +3092,7 @@ TEST_F(WvCdmRequestLicenseTest, OfflineLicenseRenewal) {
TEST_F(WvCdmRequestLicenseTest, OfflineLicenseRenewalAndRelease) { TEST_F(WvCdmRequestLicenseTest, OfflineLicenseRenewalAndRelease) {
Unprovision(); Unprovision();
Provision(kLevelDefault); Provision();
// override default settings unless configured through the command line // override default settings unless configured through the command line
std::string key_id; std::string key_id;
@@ -3366,7 +3364,7 @@ class WvCdmOfflineLicenseReleaseTest
TEST_P(WvCdmOfflineLicenseReleaseTest, WithClientId) { TEST_P(WvCdmOfflineLicenseReleaseTest, WithClientId) {
Unprovision(); Unprovision();
Provision(kLevelDefault); Provision();
RenewWithClientIdTestConfiguration* config = GetParam(); RenewWithClientIdTestConfiguration* config = GetParam();
std::string key_id; std::string key_id;
@@ -3511,7 +3509,7 @@ class WvCdmUsageTest : public WvCdmRequestLicenseTest,
TEST_P(WvCdmUsageTest, WithClientId) { TEST_P(WvCdmUsageTest, WithClientId) {
Unprovision(); Unprovision();
Provision(kLevelDefault); Provision();
CdmSecurityLevel security_level = GetDefaultSecurityLevel(); CdmSecurityLevel security_level = GetDefaultSecurityLevel();
std::string app_id = ""; std::string app_id = "";
@@ -3633,7 +3631,7 @@ INSTANTIATE_TEST_CASE_P(
TEST_F(WvCdmRequestLicenseTest, UsageInfoRetryTest) { TEST_F(WvCdmRequestLicenseTest, UsageInfoRetryTest) {
Unprovision(); Unprovision();
Provision(kLevelDefault); Provision();
CdmSecurityLevel security_level = GetDefaultSecurityLevel(); CdmSecurityLevel security_level = GetDefaultSecurityLevel();
std::string app_id = ""; std::string app_id = "";
@@ -3710,7 +3708,7 @@ TEST_F(WvCdmRequestLicenseTest, UsageInfoRetryTest) {
TEST_F(WvCdmRequestLicenseTest, UsageInfo_ReleaseThreeRecords) { TEST_F(WvCdmRequestLicenseTest, UsageInfo_ReleaseThreeRecords) {
Unprovision(); Unprovision();
Provision(kLevelDefault); Provision();
CdmSecurityLevel security_level = GetDefaultSecurityLevel(); CdmSecurityLevel security_level = GetDefaultSecurityLevel();
std::string app_id = ""; std::string app_id = "";
@@ -3810,10 +3808,10 @@ TEST_P(WvCdmUsageInfoTest, UsageInfo) {
if (kLevel3 == usage_info_data->security_level) { if (kLevel3 == usage_info_data->security_level) {
client_property_set.set_security_level(QUERY_VALUE_SECURITY_LEVEL_L3); client_property_set.set_security_level(QUERY_VALUE_SECURITY_LEVEL_L3);
property_set = &client_property_set; property_set = &client_property_set;
Provision(kLevel3); Provision(kDefaultCdmIdentifier, kLevel3);
Provision(kLevelDefault); Provision();
} else { } else {
Provision(kLevelDefault); Provision();
} }
CdmSecurityLevel security_level = GetDefaultSecurityLevel(); CdmSecurityLevel security_level = GetDefaultSecurityLevel();
@@ -3901,7 +3899,7 @@ TEST_F(WvCdmRequestLicenseTest, UsageRemoveAllTest) {
std::string app_id_not_empty = "not empty"; std::string app_id_not_empty = "not empty";
TestWvCdmClientPropertySet property_set; TestWvCdmClientPropertySet property_set;
Provision(kLevelDefault); Provision();
CdmSecurityLevel security_level = GetDefaultSecurityLevel(); CdmSecurityLevel security_level = GetDefaultSecurityLevel();
FileSystem file_system; FileSystem file_system;
@@ -3989,7 +3987,7 @@ TEST_F(WvCdmRequestLicenseTest, RemoveCorruptedUsageInfoTest) {
std::string app_id_not_empty = "not empty"; std::string app_id_not_empty = "not empty";
TestWvCdmClientPropertySet property_set; TestWvCdmClientPropertySet property_set;
Provision(kLevelDefault); Provision();
CdmSecurityLevel security_level = GetDefaultSecurityLevel(); CdmSecurityLevel security_level = GetDefaultSecurityLevel();
FileSystem file_system; FileSystem file_system;
@@ -4125,7 +4123,7 @@ TEST_F(WvCdmRequestLicenseTest, RemoveCorruptedUsageInfoTest2) {
std::string app_id_not_empty = "not empty"; std::string app_id_not_empty = "not empty";
TestWvCdmClientPropertySet property_set; TestWvCdmClientPropertySet property_set;
Provision(kLevelDefault); Provision();
CdmSecurityLevel security_level = GetDefaultSecurityLevel(); CdmSecurityLevel security_level = GetDefaultSecurityLevel();
FileSystem file_system; FileSystem file_system;
@@ -4274,7 +4272,7 @@ TEST_F(WvCdmRequestLicenseTest, GetSecureStopIdsTest) {
std::string app_id_empty = ""; std::string app_id_empty = "";
TestWvCdmClientPropertySet property_set; TestWvCdmClientPropertySet property_set;
Provision(kLevelDefault); Provision();
CdmSecurityLevel security_level = GetDefaultSecurityLevel(); CdmSecurityLevel security_level = GetDefaultSecurityLevel();
FileSystem file_system; FileSystem file_system;
@@ -4424,7 +4422,7 @@ TEST_F(WvCdmRequestLicenseTest, UsageRecoveryTest) {
std::string app_id_empty = ""; std::string app_id_empty = "";
TestWvCdmClientPropertySet property_set; TestWvCdmClientPropertySet property_set;
Provision(kLevelDefault); Provision();
CdmSecurityLevel security_level = GetDefaultSecurityLevel(); CdmSecurityLevel security_level = GetDefaultSecurityLevel();
FileSystem file_system; FileSystem file_system;
@@ -4534,7 +4532,7 @@ TEST_F(WvCdmRequestLicenseTest, UsageRemoveSecureStopTest) {
std::string app_id_empty = ""; std::string app_id_empty = "";
TestWvCdmClientPropertySet property_set; TestWvCdmClientPropertySet property_set;
Provision(kLevelDefault); Provision();
CdmSecurityLevel security_level = GetDefaultSecurityLevel(); CdmSecurityLevel security_level = GetDefaultSecurityLevel();
FileSystem file_system; FileSystem file_system;
@@ -4645,7 +4643,7 @@ TEST_F(WvCdmRequestLicenseTest, UsageRemoveSecureStopTest) {
// TODO(rfrias): Enable when b/123370099 has been addressed // TODO(rfrias): Enable when b/123370099 has been addressed
TEST_F(WvCdmRequestLicenseTest, VerifyProviderClientToken) { TEST_F(WvCdmRequestLicenseTest, VerifyProviderClientToken) {
Unprovision(); Unprovision();
Provision(kLevelDefault); Provision();
// The default offline asset "offline_clip2" does not include a // The default offline asset "offline_clip2" does not include a
// provider session token but "offline_clip5" does, so replace the last // provider session token but "offline_clip5" does, so replace the last
@@ -4763,7 +4761,7 @@ TEST_F(WvCdmRequestLicenseTest, QueryUnmodifiedSessionStatus) {
TEST_F(WvCdmRequestLicenseTest, QueryModifiedSessionStatus) { TEST_F(WvCdmRequestLicenseTest, QueryModifiedSessionStatus) {
// Test that L3 is returned when properties downgrade security. // Test that L3 is returned when properties downgrade security.
Unprovision(); Unprovision();
Provision(kLevel3); Provision(kDefaultCdmIdentifier, kLevel3);
TestWvCdmClientPropertySet property_set_L3; TestWvCdmClientPropertySet property_set_L3;
property_set_L3.set_security_level(QUERY_VALUE_SECURITY_LEVEL_L3); property_set_L3.set_security_level(QUERY_VALUE_SECURITY_LEVEL_L3);
@@ -4772,7 +4770,7 @@ TEST_F(WvCdmRequestLicenseTest, QueryModifiedSessionStatus) {
TEST_F(WvCdmRequestLicenseTest, QueryKeyStatus) { TEST_F(WvCdmRequestLicenseTest, QueryKeyStatus) {
Unprovision(); Unprovision();
Provision(kLevelDefault); Provision();
decryptor_->OpenSession(config_.key_system(), nullptr, kDefaultCdmIdentifier, decryptor_->OpenSession(config_.key_system(), nullptr, kDefaultCdmIdentifier,
nullptr, &session_id_); nullptr, &session_id_);
@@ -5054,7 +5052,7 @@ TEST_F(WvCdmRequestLicenseTest, QueryStatusL3) {
TEST_F(WvCdmRequestLicenseTest, QueryOemCryptoSessionId) { TEST_F(WvCdmRequestLicenseTest, QueryOemCryptoSessionId) {
Unprovision(); Unprovision();
Provision(kLevelDefault); Provision();
decryptor_->OpenSession(config_.key_system(), nullptr, kDefaultCdmIdentifier, decryptor_->OpenSession(config_.key_system(), nullptr, kDefaultCdmIdentifier,
nullptr, &session_id_); nullptr, &session_id_);
@@ -5080,8 +5078,7 @@ TEST_F(WvCdmRequestLicenseTest, QueryOemCryptoSessionId) {
TEST_F(WvCdmRequestLicenseTest, IsSecurityLevelSupported) { TEST_F(WvCdmRequestLicenseTest, IsSecurityLevelSupported) {
// Level 1 may either be or not be supported. Invoking the method without // Level 1 may either be or not be supported. Invoking the method without
// imposing any expecations to make sure it completes. // imposing any expecations to make sure it completes.
bool is_supported = WvContentDecryptionModule::IsSecurityLevelSupported( WvContentDecryptionModule::IsSecurityLevelSupported(wvcdm::kSecurityLevelL1);
wvcdm::kSecurityLevelL1);
EXPECT_FALSE(WvContentDecryptionModule::IsSecurityLevelSupported( EXPECT_FALSE(WvContentDecryptionModule::IsSecurityLevelSupported(
wvcdm::kSecurityLevelL2)); wvcdm::kSecurityLevelL2));
EXPECT_TRUE(WvContentDecryptionModule::IsSecurityLevelSupported( EXPECT_TRUE(WvContentDecryptionModule::IsSecurityLevelSupported(
@@ -5683,7 +5680,7 @@ class WvHlsDecryptionTest
public ::testing::WithParamInterface<HlsDecryptionInfo*> {}; public ::testing::WithParamInterface<HlsDecryptionInfo*> {};
TEST_P(WvHlsDecryptionTest, HlsDecryptionTest) { TEST_P(WvHlsDecryptionTest, HlsDecryptionTest) {
Provision(kLevel3); Provision(kDefaultCdmIdentifier, kLevel3);
TestWvCdmClientPropertySet client_property_set; TestWvCdmClientPropertySet client_property_set;
client_property_set.set_security_level(QUERY_VALUE_SECURITY_LEVEL_L3); client_property_set.set_security_level(QUERY_VALUE_SECURITY_LEVEL_L3);
HlsDecryptionInfo* info = GetParam(); HlsDecryptionInfo* info = GetParam();
@@ -5737,7 +5734,7 @@ class WvHlsFourCCBackwardCompatibilityTest
public ::testing::WithParamInterface<HlsDecryptionInfo*> {}; public ::testing::WithParamInterface<HlsDecryptionInfo*> {};
TEST_P(WvHlsFourCCBackwardCompatibilityTest, HlsDecryptionTest) { TEST_P(WvHlsFourCCBackwardCompatibilityTest, HlsDecryptionTest) {
Provision(kLevel3); Provision(kDefaultCdmIdentifier, kLevel3);
TestWvCdmClientPropertySet client_property_set; TestWvCdmClientPropertySet client_property_set;
client_property_set.set_security_level(QUERY_VALUE_SECURITY_LEVEL_L3); client_property_set.set_security_level(QUERY_VALUE_SECURITY_LEVEL_L3);
HlsDecryptionInfo* info = GetParam(); HlsDecryptionInfo* info = GetParam();
@@ -5792,7 +5789,7 @@ class WvCenc30Test
public ::testing::WithParamInterface<SingleSampleDecryptionInfo*> {}; public ::testing::WithParamInterface<SingleSampleDecryptionInfo*> {};
TEST_P(WvCenc30Test, DecryptionTest) { TEST_P(WvCenc30Test, DecryptionTest) {
Provision(kLevel3); Provision(kDefaultCdmIdentifier, kLevel3);
TestWvCdmClientPropertySet client_property_set; TestWvCdmClientPropertySet client_property_set;
client_property_set.set_security_level(QUERY_VALUE_SECURITY_LEVEL_L3); client_property_set.set_security_level(QUERY_VALUE_SECURITY_LEVEL_L3);
@@ -5855,7 +5852,7 @@ class WvCenc30SwitchCipherModeTest
public ::testing::WithParamInterface<FourSampleDecryptionInfo*> {}; public ::testing::WithParamInterface<FourSampleDecryptionInfo*> {};
TEST_P(WvCenc30SwitchCipherModeTest, DecryptionTest) { TEST_P(WvCenc30SwitchCipherModeTest, DecryptionTest) {
Provision(kLevel3); Provision(kDefaultCdmIdentifier, kLevel3);
TestWvCdmClientPropertySet client_property_set; TestWvCdmClientPropertySet client_property_set;
client_property_set.set_security_level(QUERY_VALUE_SECURITY_LEVEL_L3); client_property_set.set_security_level(QUERY_VALUE_SECURITY_LEVEL_L3);
@@ -5961,7 +5958,7 @@ TEST_F(WvCdmRequestLicenseTest, CloseCdmReleaseResourcesTest) {
// Enable when OEMCrypto v15 has been deployed. Currently setting a decrypt // Enable when OEMCrypto v15 has been deployed. Currently setting a decrypt
// hash returns OEMCrypto_ERROR_NOT_IMPLEMENTED // hash returns OEMCrypto_ERROR_NOT_IMPLEMENTED
TEST_F(WvCdmRequestLicenseTest, DISABLED_DecryptPathTest) { TEST_F(WvCdmRequestLicenseTest, DISABLED_DecryptPathTest) {
Provision(kDefaultCdmIdentifier, kLevelDefault); Provision();
// Retrieve a streaming license // Retrieve a streaming license
EXPECT_EQ(NO_ERROR, decryptor_->OpenSession(config_.key_system(), nullptr, EXPECT_EQ(NO_ERROR, decryptor_->OpenSession(config_.key_system(), nullptr,
@@ -6084,7 +6081,7 @@ class WvCdmRequestLicenseRollbackTest
TEST_F(WvCdmRequestLicenseRollbackTest, Streaming_ExpireAfterRollback) { TEST_F(WvCdmRequestLicenseRollbackTest, Streaming_ExpireAfterRollback) {
Unprovision(); Unprovision();
Provision(kLevelDefault); Provision();
ASSERT_EQ(NO_ERROR, decryptor_->OpenSession(config_.key_system(), nullptr, ASSERT_EQ(NO_ERROR, decryptor_->OpenSession(config_.key_system(), nullptr,
kDefaultCdmIdentifier, nullptr, kDefaultCdmIdentifier, nullptr,
@@ -6111,7 +6108,7 @@ TEST_F(WvCdmRequestLicenseRollbackTest, Streaming_ExpireAfterRollback) {
TEST_F(WvCdmRequestLicenseRollbackTest, Streaming_ExpireBeforeRollback) { TEST_F(WvCdmRequestLicenseRollbackTest, Streaming_ExpireBeforeRollback) {
Unprovision(); Unprovision();
Provision(kLevelDefault); Provision();
ASSERT_EQ(NO_ERROR, decryptor_->OpenSession(config_.key_system(), nullptr, ASSERT_EQ(NO_ERROR, decryptor_->OpenSession(config_.key_system(), nullptr,
kDefaultCdmIdentifier, nullptr, kDefaultCdmIdentifier, nullptr,
@@ -6137,7 +6134,7 @@ TEST_F(WvCdmRequestLicenseRollbackTest, Streaming_ExpireBeforeRollback) {
TEST_F(WvCdmRequestLicenseRollbackTest, Offline_RollbackBeforeRestoreKey) { TEST_F(WvCdmRequestLicenseRollbackTest, Offline_RollbackBeforeRestoreKey) {
Unprovision(); Unprovision();
Provision(kLevelDefault); Provision();
std::string unused_key_id; std::string unused_key_id;
std::string client_auth; std::string client_auth;
@@ -6184,7 +6181,7 @@ TEST_F(WvCdmRequestLicenseRollbackTest, Offline_RollbackBeforeRestoreKey) {
TEST_F(WvCdmRequestLicenseRollbackTest, TEST_F(WvCdmRequestLicenseRollbackTest,
Offline_RollbackAndExpireAfterRestoreKey) { Offline_RollbackAndExpireAfterRestoreKey) {
Unprovision(); Unprovision();
Provision(kLevelDefault); Provision();
std::string unused_key_id; std::string unused_key_id;
std::string client_auth; std::string client_auth;
@@ -6222,7 +6219,7 @@ TEST_F(WvCdmRequestLicenseRollbackTest,
TEST_F(WvCdmRequestLicenseRollbackTest, TEST_F(WvCdmRequestLicenseRollbackTest,
Offline_ExpireAndRollbackAfterRestoreKey) { Offline_ExpireAndRollbackAfterRestoreKey) {
Unprovision(); Unprovision();
Provision(kLevelDefault); Provision();
std::string unused_key_id; std::string unused_key_id;
std::string client_auth; std::string client_auth;

View File

@@ -197,14 +197,16 @@ class CDPMatcherFactory {
// time. // time.
class CDPMatcher { class CDPMatcher {
public: public:
// TODO b/35259313: Uncomment out parameters when addressed
CDPMatcher(bool isSecure, CdmCipherMode cipherMode, uint8_t* keyId, CDPMatcher(bool isSecure, CdmCipherMode cipherMode, uint8_t* keyId,
void* out, size_t outLen, bool isEncrypted, uint8_t* in, void* /* out */, size_t outLen, bool isEncrypted,
size_t inLen, uint8_t* iv, size_t blockOffset, uint8_t* /* in */, size_t inLen, uint8_t* iv,
size_t outOffset, uint8_t flags, bool isVideo, size_t blockOffset, size_t outOffset, uint8_t flags,
bool isVideo,
CdmCencPatternEncryptionDescriptor& cdmPatternDesc) CdmCencPatternEncryptionDescriptor& cdmPatternDesc)
: mIsSecure(isSecure), mCipherMode(cipherMode), mKeyId(keyId), : mIsSecure(isSecure), mCipherMode(cipherMode), mKeyId(keyId),
mOut(out), mOutLen(outLen), mIsEncrypted(isEncrypted), mIn(in), /* mOut(out), */ mOutLen(outLen), mIsEncrypted(isEncrypted),
mInLen(inLen), mIv(iv), mBlockOffset(blockOffset), /* mIn(in), */ mInLen(inLen), mIv(iv), mBlockOffset(blockOffset),
mOutOffset(outOffset), mFlags(flags), mIsVideo(isVideo), mOutOffset(outOffset), mFlags(flags), mIsVideo(isVideo),
mCdmPatternDesc(cdmPatternDesc) {} mCdmPatternDesc(cdmPatternDesc) {}
@@ -232,10 +234,12 @@ class CDPMatcherFactory {
bool mIsSecure; bool mIsSecure;
CdmCipherMode mCipherMode; CdmCipherMode mCipherMode;
uint8_t* mKeyId; uint8_t* mKeyId;
void* mOut; // TODO b/35259313
//void* mOut;
size_t mOutLen; size_t mOutLen;
bool mIsEncrypted; bool mIsEncrypted;
uint8_t* mIn; // TODO b/35259313
//uint8_t* mIn;
size_t mInLen; size_t mInLen;
uint8_t* mIv; uint8_t* mIv;
size_t mBlockOffset; size_t mBlockOffset;

View File

@@ -94,13 +94,13 @@ bool HasMetric(const DrmMetricGroup::Metric& expected,
if (expected.values == it->values) { if (expected.values == it->values) {
ALOGE("values match."); ALOGE("values match.");
} else { } else {
ALOGE("values length match? %d, %d", ALOGE("values length match? %zu, %zu",
expected.values.size(), it->values.size()); expected.values.size(), it->values.size());
if (expected.values.size() == it->values.size()) { if (expected.values.size() == it->values.size()) {
for (unsigned int i = 0; i < expected.values.size(); i++) { for (unsigned int i = 0; i < expected.values.size(); i++) {
ALOGE("value %d match? %d", i, expected.values[i] == it->values[i]); ALOGE("value %u match? %d", i, expected.values[i] == it->values[i]);
if (expected.values[i] != it->values[i]) { if (expected.values[i] != it->values[i]) {
ALOGE("value component mismatch. %d. %s, %s", ALOGE("value component mismatch. %u. %s, %s",
i, expected.values[i].componentName.c_str(), i, expected.values[i].componentName.c_str(),
it->values[i].componentName.c_str()); it->values[i].componentName.c_str());
} }