Fix formatting of renew on license load integration tests

[ Merge of http://go/wvgerrit/174270 ]

Bug: 240995342
Test: Duration use case tests
Change-Id: I900040256b4accf2b695a6da0827033eadb4f2e4
This commit is contained in:
Rahul Frias
2023-05-08 16:14:07 -07:00
parent 1a42aed25b
commit f0e546d703

View File

@@ -1533,9 +1533,11 @@ class CdmUseCase_RenewOnLicenseLoad : public RenewalTest {
timer_limits_.initial_renewal_duration_seconds = timer_limits_.initial_renewal_duration_seconds =
renewal_delay_ + renewal_recovery_; renewal_delay_ + renewal_recovery_;
// Calculate the renewal cutoff:
renewal_cutoff_ = start_of_playback_ + renewal_delay_ + renewal_recovery_;
// Load the renewal just before the cutoff: // Load the renewal just before the cutoff:
renewal_load_time_ = renewal_load_time_ = renewal_cutoff_ - kFudge;
start_of_playback_ + renewal_delay_ + renewal_recovery_ - 1;
} }
void SetUp() override { void SetUp() override {
@@ -1548,6 +1550,7 @@ class CdmUseCase_RenewOnLicenseLoad : public RenewalTest {
} }
} }
uint64_t renewal_cutoff_;
uint64_t renewal_delay_; uint64_t renewal_delay_;
uint64_t renewal_load_time_; uint64_t renewal_load_time_;
uint64_t renewal_recovery_; uint64_t renewal_recovery_;
@@ -1561,9 +1564,8 @@ TEST_P(CdmUseCase_RenewOnLicenseLoad, Case1S) {
SleepUntilRenewalNeeded(); SleepUntilRenewalNeeded();
RequestRenewal(kRenewOnLicenseLoad); 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 stop = 45; const uint64_t stop = 45;
RenewAndContinue(start, load_renewal, stop, kRenewOnLicenseLoad); RenewAndContinue(start, renewal_load_time_, stop, kRenewOnLicenseLoad);
} }
// License loaded within rental duration window and playback continues. // License loaded within rental duration window and playback continues.
@@ -1573,10 +1575,9 @@ TEST_P(CdmUseCase_RenewOnLicenseLoad, Case1M) {
LoadLicense(); LoadLicense();
SleepUntilRenewalNeeded(); SleepUntilRenewalNeeded();
RequestRenewal(kRenewOnLicenseLoad); RequestRenewal(kRenewOnLicenseLoad);
const uint64_t start = 20; // time of first decrypt const uint64_t start = 25; // time of first decrypt
const uint64_t load_renewal = 20;
const uint64_t stop = 45; // end of decrypt const uint64_t stop = 45; // end of decrypt
RenewAndContinue(start, load_renewal, stop, kRenewOnLicenseLoad); RenewAndContinue(start, renewal_load_time_, stop, kRenewOnLicenseLoad);
} }
// License loaded within rental duration window and playback continues. // License loaded within rental duration window and playback continues.
@@ -1586,10 +1587,9 @@ TEST_P(CdmUseCase_RenewOnLicenseLoad, Case1L) {
LoadLicense(); LoadLicense();
SleepUntilRenewalNeeded(); SleepUntilRenewalNeeded();
RequestRenewal(kRenewOnLicenseLoad); RequestRenewal(kRenewOnLicenseLoad);
const uint64_t load_renewal = 20; const uint64_t start = 35; // time of first decrypt
const uint64_t start = 25; // time of first decrypt
const uint64_t stop = 45; // end of decrypt const uint64_t stop = 45; // end of decrypt
LoadRenewal(load_renewal, kRenewOnLicenseLoad); LoadRenewal(renewal_load_time_, kRenewOnLicenseLoad);
AllowPlayback(start, stop); AllowPlayback(start, stop);
} }
@@ -1607,9 +1607,7 @@ TEST_P(CdmUseCase_RenewOnLicenseLoad, Case3S) {
LoadLicense(); LoadLicense();
const uint64_t start = 15; // time of first decrypt const uint64_t start = 15; // time of first decrypt
// Allow playback within the initial renewal window. // Allow playback within the initial renewal window.
const uint64_t cutoff = TerminatePlayback(start, renewal_cutoff_);
start_of_playback_ + renewal_delay_ + renewal_recovery_;
TerminatePlayback(start, cutoff);
} }
// License loaded within rental duration window but renewal not received. // License loaded within rental duration window but renewal not received.
@@ -1619,9 +1617,7 @@ TEST_P(CdmUseCase_RenewOnLicenseLoad, Case3M) {
LoadLicense(); LoadLicense();
const uint64_t start = 25; // time of first decrypt const uint64_t start = 25; // time of first decrypt
// Allow playback within the initial renewal window. // Allow playback within the initial renewal window.
const uint64_t cutoff = TerminatePlayback(start, renewal_cutoff_);
start_of_playback_ + renewal_delay_ + renewal_recovery_;
TerminatePlayback(start, cutoff);
} }
// License loaded within rental duration window but renewal not received. // License loaded within rental duration window but renewal not received.