Refactor WvCdmEventListener and some cleanups
Bug: 19771437 It is a merge of below CLs from Widevine CDM repo: Clean up CdmSession and PolicyEngine testing injection https://widevine-internal-review.googlesource.com/#/c/13700 Refactor WvCdmEventListener handling https://widevine-internal-review.googlesource.com/#/c/13702 Change-Id: I356b90000c056113d394926862b859aab380d305
This commit is contained in:
@@ -396,7 +396,7 @@ class WvCdmExtendedDurationTest : public testing::Test {
|
||||
|
||||
void Provision() {
|
||||
CdmResponseType status =
|
||||
decryptor_.OpenSession(g_key_system, NULL, &session_id_);
|
||||
decryptor_.OpenSession(g_key_system, NULL, NULL, &session_id_);
|
||||
switch (status) {
|
||||
case NO_ERROR:
|
||||
decryptor_.CloseSession(session_id_);
|
||||
@@ -644,7 +644,7 @@ class WvCdmExtendedDurationTest : public testing::Test {
|
||||
}
|
||||
|
||||
std::string GetSecurityLevel(TestWvCdmClientPropertySet* property_set) {
|
||||
decryptor_.OpenSession(g_key_system, property_set, &session_id_);
|
||||
decryptor_.OpenSession(g_key_system, property_set, NULL, &session_id_);
|
||||
CdmQueryMap query_info;
|
||||
EXPECT_EQ(wvcdm::NO_ERROR,
|
||||
decryptor_.QuerySessionStatus(session_id_, &query_info));
|
||||
@@ -678,7 +678,7 @@ class WvCdmExtendedDurationTest : public testing::Test {
|
||||
|
||||
TEST_F(WvCdmExtendedDurationTest, VerifyLicenseRequestTest) {
|
||||
Provision();
|
||||
decryptor_.OpenSession(g_key_system, NULL, &session_id_);
|
||||
decryptor_.OpenSession(g_key_system, NULL, NULL, &session_id_);
|
||||
GenerateKeyRequest(g_key_id, kLicenseTypeStreaming);
|
||||
|
||||
EXPECT_TRUE(!key_msg_.empty());
|
||||
@@ -746,7 +746,7 @@ TEST_F(WvCdmExtendedDurationTest, VerifyLicenseRequestTest) {
|
||||
|
||||
TEST_F(WvCdmExtendedDurationTest, VerifyLicenseRenewalTest) {
|
||||
Provision();
|
||||
decryptor_.OpenSession(g_key_system, NULL, &session_id_);
|
||||
decryptor_.OpenSession(g_key_system, NULL, NULL, &session_id_);
|
||||
GenerateKeyRequest(g_key_id, kLicenseTypeStreaming);
|
||||
VerifyKeyRequestResponse(g_license_server, g_client_auth, false);
|
||||
|
||||
@@ -838,7 +838,7 @@ TEST_F(WvCdmExtendedDurationTest, UsageOverflowTest) {
|
||||
EXPECT_TRUE(handle.DeleteAllUsageInfoForApp("", &provider_session_tokens));
|
||||
|
||||
for (size_t i = 0; i < kMaxUsageTableSize + 100; ++i) {
|
||||
decryptor_.OpenSession(g_key_system, property_set, &session_id_);
|
||||
decryptor_.OpenSession(g_key_system, property_set, NULL, &session_id_);
|
||||
std::string key_id = a2bs_hex(
|
||||
"000000427073736800000000" // blob size and pssh
|
||||
"EDEF8BA979D64ACEA3C827DCD51D21ED00000022" // Widevine system id
|
||||
@@ -878,7 +878,7 @@ TEST_P(WvCdmStreamingNoPstTest, UsageTest) {
|
||||
Unprovision();
|
||||
Provision();
|
||||
|
||||
decryptor_.OpenSession(g_key_system, NULL, &session_id_);
|
||||
decryptor_.OpenSession(g_key_system, NULL, NULL, &session_id_);
|
||||
GenerateKeyRequest(g_key_id, kLicenseTypeStreaming);
|
||||
VerifyKeyRequestResponse(g_license_server, g_client_auth, false);
|
||||
|
||||
@@ -957,7 +957,7 @@ TEST_P(WvCdmStreamingPstTest, UsageTest) {
|
||||
Unprovision();
|
||||
Provision();
|
||||
|
||||
decryptor_.OpenSession(g_key_system, NULL, &session_id_);
|
||||
decryptor_.OpenSession(g_key_system, NULL, NULL, &session_id_);
|
||||
GenerateKeyRequest(kStreamingClip1PstInitData, kLicenseTypeStreaming);
|
||||
VerifyKeyRequestResponse(g_license_server, g_client_auth, false);
|
||||
|
||||
@@ -1036,7 +1036,7 @@ TEST_P(WvCdmStreamingUsageReportTest, UsageTest) {
|
||||
Unprovision();
|
||||
Provision();
|
||||
|
||||
decryptor_.OpenSession(g_key_system, NULL, &session_id_);
|
||||
decryptor_.OpenSession(g_key_system, NULL, NULL, &session_id_);
|
||||
GenerateKeyRequest(kStreamingClip1PstInitData, kLicenseTypeStreaming);
|
||||
VerifyKeyRequestResponse(g_license_server, g_client_auth, false);
|
||||
|
||||
@@ -1137,7 +1137,7 @@ TEST_P(WvCdmOfflineUsageReportTest, UsageTest) {
|
||||
Unprovision();
|
||||
Provision();
|
||||
|
||||
decryptor_.OpenSession(g_key_system, NULL, &session_id_);
|
||||
decryptor_.OpenSession(g_key_system, NULL, NULL, &session_id_);
|
||||
GenerateKeyRequest(kOfflineClip2PstInitData, kLicenseTypeOffline);
|
||||
VerifyKeyRequestResponse(g_license_server, g_client_auth, false);
|
||||
|
||||
@@ -1160,7 +1160,7 @@ TEST_P(WvCdmOfflineUsageReportTest, UsageTest) {
|
||||
|
||||
for (size_t i = 0; i < GetParam(); ++i) {
|
||||
session_id_.clear();
|
||||
decryptor_.OpenSession(g_key_system, NULL, &session_id_);
|
||||
decryptor_.OpenSession(g_key_system, NULL, NULL, &session_id_);
|
||||
EXPECT_EQ(wvcdm::KEY_ADDED, decryptor_.RestoreKey(session_id_, key_set_id));
|
||||
|
||||
// Query and validate usage information
|
||||
@@ -1207,7 +1207,7 @@ TEST_P(WvCdmOfflineUsageReportTest, UsageTest) {
|
||||
}
|
||||
|
||||
session_id_.clear();
|
||||
decryptor_.OpenSession(g_key_system, NULL, &session_id_);
|
||||
decryptor_.OpenSession(g_key_system, NULL, NULL, &session_id_);
|
||||
EXPECT_EQ(wvcdm::KEY_ADDED, decryptor_.RestoreKey(session_id_, key_set_id));
|
||||
|
||||
// Query and validate usage information
|
||||
|
||||
Reference in New Issue
Block a user