Merge "Expect failure on license load for expired LDL license" into udc-dev am: 6511d44f3c am: 7e714045b6 am: 44d207e4a2
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/23049483 Change-Id: I18e085837156a718791cf54fbdea5f51c8da4021 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -1557,6 +1557,7 @@ TEST_P(CdmUseCase_RenewOnLicenseLoad, Case1S) {
|
|||||||
SleepUntil(start_of_playback_);
|
SleepUntil(start_of_playback_);
|
||||||
LoadLicense();
|
LoadLicense();
|
||||||
SleepUntilRenewalNeeded();
|
SleepUntilRenewalNeeded();
|
||||||
|
RequestRenewal(kRenewOnLicenseLoad);
|
||||||
const uint64_t start = 15; // time of first decrypt
|
const uint64_t start = 15; // time of first decrypt
|
||||||
const uint64_t load_renewal = 20;
|
const uint64_t load_renewal = 20;
|
||||||
const uint64_t stop = 45;
|
const uint64_t stop = 45;
|
||||||
@@ -1569,6 +1570,7 @@ TEST_P(CdmUseCase_RenewOnLicenseLoad, Case1M) {
|
|||||||
SleepUntil(start_of_playback_);
|
SleepUntil(start_of_playback_);
|
||||||
LoadLicense();
|
LoadLicense();
|
||||||
SleepUntilRenewalNeeded();
|
SleepUntilRenewalNeeded();
|
||||||
|
RequestRenewal(kRenewOnLicenseLoad);
|
||||||
const uint64_t start = 20; // time of first decrypt
|
const uint64_t start = 20; // time of first decrypt
|
||||||
const uint64_t load_renewal = 20;
|
const uint64_t load_renewal = 20;
|
||||||
const uint64_t stop = 45; // end of decrypt
|
const uint64_t stop = 45; // end of decrypt
|
||||||
@@ -1591,8 +1593,9 @@ TEST_P(CdmUseCase_RenewOnLicenseLoad, Case1L) {
|
|||||||
|
|
||||||
// License loaded after rental duration window and playback should fail.
|
// License loaded after rental duration window and playback should fail.
|
||||||
TEST_P(CdmUseCase_RenewOnLicenseLoad, Case2) {
|
TEST_P(CdmUseCase_RenewOnLicenseLoad, Case2) {
|
||||||
start_of_playback_ = EndOfRentalWindow() + 1;
|
start_of_playback_ = EndOfRentalWindow() + kFudge;
|
||||||
ForbidPlayback(start_of_playback_);
|
SleepUntil(start_of_playback_);
|
||||||
|
license_holder_.FailLoadLicense();
|
||||||
}
|
}
|
||||||
|
|
||||||
// License loaded within rental duration window but renewal not received.
|
// License loaded within rental duration window but renewal not received.
|
||||||
@@ -1637,6 +1640,7 @@ TEST_P(CdmUseCase_RenewOnLicenseLoad, Case4) {
|
|||||||
SleepUntil(start_of_playback_);
|
SleepUntil(start_of_playback_);
|
||||||
LoadLicense();
|
LoadLicense();
|
||||||
SleepUntilRenewalNeeded();
|
SleepUntilRenewalNeeded();
|
||||||
|
RequestRenewal(kRenewOnLicenseLoad);
|
||||||
const uint64_t start = 20; // time of first decrypt
|
const uint64_t start = 20; // time of first decrypt
|
||||||
const uint64_t load_renewal = 20;
|
const uint64_t load_renewal = 20;
|
||||||
const uint64_t stop = 45; // end of decrypt
|
const uint64_t stop = 45; // end of decrypt
|
||||||
|
|||||||
@@ -55,6 +55,13 @@ void LicenseHolder::LoadLicense() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LicenseHolder::FailLoadLicense() {
|
||||||
|
CdmLicenseType license_type;
|
||||||
|
ASSERT_NE(KEY_ADDED, cdm_engine_->AddKey(session_id_, key_response_,
|
||||||
|
&license_type, &key_set_id_))
|
||||||
|
<< "Unexpected success loading license for " << content_id();
|
||||||
|
}
|
||||||
|
|
||||||
void LicenseHolder::ReloadLicense() {
|
void LicenseHolder::ReloadLicense() {
|
||||||
CdmResponseType status = cdm_engine_->RestoreKey(session_id_, key_set_id_);
|
CdmResponseType status = cdm_engine_->RestoreKey(session_id_, key_set_id_);
|
||||||
ASSERT_EQ(KEY_ADDED, status)
|
ASSERT_EQ(KEY_ADDED, status)
|
||||||
|
|||||||
@@ -59,6 +59,9 @@ class LicenseHolder {
|
|||||||
// Load the license response into the CDM engine. A call to FetchLicense()
|
// Load the license response into the CDM engine. A call to FetchLicense()
|
||||||
// must be made first.
|
// must be made first.
|
||||||
void LoadLicense();
|
void LoadLicense();
|
||||||
|
// Attempt to load the license response into the CDM engine, but expect a
|
||||||
|
// failure.
|
||||||
|
void FailLoadLicense();
|
||||||
// Reload the license. Call OpenSession() before calling
|
// Reload the license. Call OpenSession() before calling
|
||||||
// ReloadLicense(). Also, the key_set_id must have been set previously. The
|
// ReloadLicense(). Also, the key_set_id must have been set previously. The
|
||||||
// key_set_id is set by calling LoadLicense(), or by calling set_key_set_id().
|
// key_set_id is set by calling LoadLicense(), or by calling set_key_set_id().
|
||||||
|
|||||||
Reference in New Issue
Block a user