Remove ExpiryOnReleaseOfflineKeyTest

The test verifies that a downloaded license receives an expiry event
in a session if it is released from another session. With
the introduction of the big usage table feature loading a
license/usage entry into multiple sessions is not permitted and
so this test is no longer needed.

Some OEMCrypto implementations might require OEMCrypto_UpdateUsageEntry
to be called between calls to OEMCrypto_LoadKeys and
OEMCrypto_ReportUsage. This CL adds the call to
OEMCrypto_UpdateUsageEntry.

Test: WV unit/integration test
Test: Playback using play movies and netflix
Test: GTS tests

Bug: 64988654
Change-Id: Ic737c3200ea1858736a168be835507378eaf7b3e
This commit is contained in:
Rahul Frias
2017-09-06 12:06:05 -07:00
parent e492811200
commit cb8bb251e4
4 changed files with 11 additions and 52 deletions

View File

@@ -2019,55 +2019,6 @@ TEST_F(WvCdmRequestLicenseTest,
VerifyKeyRequestResponse(g_license_server, client_auth);
}
TEST_F(WvCdmRequestLicenseTest, ExpiryOnReleaseOfflineKeyTest) {
Unprovision();
Provision(kLevelDefault);
// override default settings unless configured through the command line
std::string key_id;
std::string client_auth;
GetOfflineConfiguration(&key_id, &client_auth);
decryptor_.OpenSession(g_key_system, NULL, kDefaultCdmIdentifier, NULL,
&session_id_);
GenerateKeyRequest(key_id, kLicenseTypeOffline);
VerifyKeyRequestResponse(g_license_server, client_auth);
CdmKeySetId key_set_id = key_set_id_;
EXPECT_FALSE(key_set_id_.empty());
decryptor_.CloseSession(session_id_);
session_id_.clear();
key_set_id_.clear();
StrictMock<TestWvCdmEventListener> listener;
decryptor_.OpenSession(g_key_system, NULL, kDefaultCdmIdentifier, &listener,
&session_id_);
CdmSessionId restore_session_id = session_id_;
EXPECT_CALL(
listener,
OnSessionKeysChange(
restore_session_id,
AllOf(Each(Pair(_, kKeyStatusUsable)), Not(IsEmpty())), true));
EXPECT_CALL(listener, OnExpirationUpdate(restore_session_id, _));
EXPECT_EQ(wvcdm::KEY_ADDED,
decryptor_.RestoreKey(restore_session_id, key_set_id));
session_id_.clear();
key_set_id_.clear();
// Maybe called since VerifyKeyRequestResponse could take some time.
EXPECT_CALL(listener, OnSessionRenewalNeeded(restore_session_id))
.Times(AtLeast(0));
EXPECT_CALL(
listener,
OnSessionKeysChange(
restore_session_id,
AllOf(Each(Pair(_, kKeyStatusExpired)), Not(IsEmpty())), false));
GenerateKeyRelease(key_set_id);
key_set_id_ = key_set_id;
VerifyKeyRequestResponse(g_license_server, client_auth);
decryptor_.CloseSession(restore_session_id);
}
// This test verifies that repeated generation of the key release message
// for the same key_set_id results in the previous session being
// deallocated (rather than leaked) and a new one allocated.