Correct request_license_test failures
[ Merge of http://go/wvgerrit/122885 ] A recent change to the license service resulted in PSTs being inserted into persistent renewable licenses even when not specified by the content provider. This caused ReleaseOfflineKeySessionUsageDisabledTest to fail. The asset was changed to use a policy for a persistent license without renewal. Offline_RollbackBeforeRestoreKey failed because the duration of the license is short. It has expired when the clock is restored after a rollback. Bug: 181693982 Test: request_license_test Change-Id: I0a2c2a09e563c81c134fba1f310deb1eb4de26a3
This commit is contained in:
@@ -2994,12 +2994,14 @@ TEST_F(WvCdmRequestLicenseTest, ReleaseOfflineKeySessionUsageDisabledTest) {
|
||||
|
||||
// The default offline asset "offline_clip2" has the session usage table
|
||||
// entry enabled in the replay control portion of the key control block.
|
||||
// To have it disabled we must use "offline_clip1", so replace the last
|
||||
// char in init data with '1'
|
||||
// To have it disabled we must use "offline_clip7", so replace the last
|
||||
// char in init data with '7'. PST are also automatically inserted into
|
||||
// persistent licenses with renewals. This asset has a policy that prohibits
|
||||
// renewals so no PST is specified.
|
||||
std::string key_id;
|
||||
std::string client_auth;
|
||||
GetOfflineConfiguration(&key_id, &client_auth);
|
||||
key_id[key_id.size() - 1] = '1';
|
||||
key_id[key_id.size() - 1] = '7';
|
||||
|
||||
decryptor_->OpenSession(config_.key_system(), nullptr, kDefaultCdmIdentifier,
|
||||
nullptr, &session_id_);
|
||||
@@ -6572,7 +6574,7 @@ TEST_F(WvCdmRequestLicenseRollbackTest, Offline_RollbackBeforeRestoreKey) {
|
||||
|
||||
decryptor_->RestoreKey(session_id_, key_set_id);
|
||||
|
||||
// Verify we can't decrypt.
|
||||
// Verify we can't decrypt. The license start time is in the future.
|
||||
EXPECT_EQ(DECRYPT_NOT_READY, Decrypt(session_id_));
|
||||
|
||||
RestoreSystemTime();
|
||||
@@ -6582,8 +6584,11 @@ TEST_F(WvCdmRequestLicenseRollbackTest, Offline_RollbackBeforeRestoreKey) {
|
||||
std::this_thread::sleep_for(
|
||||
std::chrono::milliseconds(kExpirationTimeMs_ / 2));
|
||||
|
||||
// Verify we can decrypt.
|
||||
EXPECT_EQ(NO_ERROR, Decrypt(session_id_));
|
||||
// Verify we can't decrypt. The playback duration is short, half of the
|
||||
// rollback time. The first playback time gets set to the rollback time
|
||||
// when the license is restored. The license has expired by the time the
|
||||
// clock is restored/rolled forward.
|
||||
EXPECT_EQ(NEED_KEY, Decrypt(session_id_));
|
||||
|
||||
ASSERT_EQ(NO_ERROR, decryptor_->CloseSession(session_id_));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user