Merge "Allow CE CDM to Create Sessions Without a Service Certificate"
This commit is contained in:
@@ -44,6 +44,8 @@ const std::string kWebmMimeType = "video/webm";
|
||||
const std::string kEmptyString;
|
||||
const std::string kComma = ",";
|
||||
|
||||
const std::string kFakeSessionId = "TotallyARealSession123456789";
|
||||
|
||||
} // namespace
|
||||
|
||||
class WvCdmEnginePreProvTest : public WvCdmTestBase {
|
||||
@@ -317,6 +319,27 @@ TEST_F(WvCdmEnginePreProvTestUat, ProvisioningServiceCertificateInvalidTest) {
|
||||
ASSERT_NE(cdm_engine_.ValidateServiceCertificate(certificate), NO_ERROR);
|
||||
};
|
||||
|
||||
TEST_F(WvCdmEngineTest, SetLicensingServiceValidCertificate) {
|
||||
ASSERT_EQ(cdm_engine_.SetSessionServiceCertificate(
|
||||
session_id_, config_.license_service_certificate()),
|
||||
NO_ERROR);
|
||||
};
|
||||
|
||||
TEST_F(WvCdmEngineTest, SetLicensingServiceCertificateUnknownSession) {
|
||||
ASSERT_EQ(cdm_engine_.SetSessionServiceCertificate(
|
||||
kFakeSessionId, config_.license_service_certificate()),
|
||||
SESSION_NOT_FOUND_22);
|
||||
};
|
||||
|
||||
TEST_F(WvCdmEngineTest, SetLicensingServiceInvalidCertificate) {
|
||||
std::string certificate = config_.license_service_certificate();
|
||||
// Add four nulls to the beginning of the cert to invalidate it
|
||||
certificate.insert(0, 4, '\0');
|
||||
|
||||
ASSERT_NE(cdm_engine_.SetSessionServiceCertificate(session_id_, certificate),
|
||||
NO_ERROR);
|
||||
};
|
||||
|
||||
TEST_F(WvCdmEnginePreProvTestStaging, ProvisioningTest) { Provision(); }
|
||||
|
||||
TEST_F(WvCdmEnginePreProvTestUatBinary, ProvisioningTest) {
|
||||
|
||||
@@ -282,10 +282,9 @@ TEST_F(CdmLicenseTest, InitWithEmptyServiceCert) {
|
||||
EXPECT_CALL(*crypto_session_, IsOpen()).WillOnce(Return(true));
|
||||
|
||||
CreateCdmLicense();
|
||||
EXPECT_EQ(cdm_license_->Init(kToken, kClientTokenDrmCert, "", true,
|
||||
kEmptyServiceCertificate, crypto_session_,
|
||||
policy_engine_),
|
||||
Properties::allow_service_certificate_requests());
|
||||
EXPECT_TRUE(cdm_license_->Init(kToken, kClientTokenDrmCert, "", true,
|
||||
kEmptyServiceCertificate, crypto_session_,
|
||||
policy_engine_));
|
||||
}
|
||||
|
||||
TEST_F(CdmLicenseTest, InitWithInvalidServiceCert) {
|
||||
|
||||
@@ -781,6 +781,9 @@ void PrintTo(const enum CdmResponseType& value, ::std::ostream* os) {
|
||||
case SESSION_NOT_FOUND_21:
|
||||
*os << "SESSION_NOT_FOUND_21";
|
||||
break;
|
||||
case SESSION_NOT_FOUND_22:
|
||||
*os << "SESSION_NOT_FOUND_22";
|
||||
break;
|
||||
case INVALID_DECRYPT_HASH_FORMAT:
|
||||
*os << "INVALID_DECRYPT_HASH_FORMAT";
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user