Add a static method to query security level

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

This allows one to be able to query for security level, from
Crypto factory methods before the plugins and CdmEngine objects
have been created.

Bug: 117104043
Test: WV Unit/integration tests
Change-Id: Id07f420c3cfb92166cd3bb3cf82148d52e10eb03
This commit is contained in:
Rahul Frias
2019-01-17 16:53:12 -08:00
parent 81e77bda58
commit 45b3f5761e
5 changed files with 45 additions and 0 deletions

View File

@@ -4291,6 +4291,21 @@ TEST_F(WvCdmRequestLicenseTest, QueryOemCryptoSessionId) {
decryptor_.CloseSession(session_id_);
}
TEST_F(WvCdmRequestLicenseTest, IsSecurityLevelSupported) {
// Level 1 may either be or not be supported. Invoking the method without
// imposing any expecations to make sure it completes.
bool is_supported = WvContentDecryptionModule::IsSecurityLevelSupported(
wvcdm::kSecurityLevelL1);
EXPECT_FALSE(WvContentDecryptionModule::IsSecurityLevelSupported(
wvcdm::kSecurityLevelL2));
EXPECT_TRUE(WvContentDecryptionModule::IsSecurityLevelSupported(
wvcdm::kSecurityLevelL3));
EXPECT_FALSE(WvContentDecryptionModule::IsSecurityLevelSupported(
wvcdm::kSecurityLevelUnknown));
EXPECT_FALSE(WvContentDecryptionModule::IsSecurityLevelSupported(
wvcdm::kSecurityLevelUninitialized));
}
TEST_F(WvCdmRequestLicenseTest, DISABLED_OfflineLicenseDecryptionTest) {
decryptor_.OpenSession(config_.key_system(), NULL, kDefaultCdmIdentifier, NULL,
&session_id_);