Playback duration should override license duration
[ Merge of go/wvgerrit/14360 ] If within playback window, do not expire license on expiry of rental or license duration. In this case playback duration will extend the license. b/17791094 Change-Id: I26d255aa8f0287bd583ebdeec991c613d49d8f22
This commit is contained in:
@@ -20,6 +20,7 @@ namespace {
|
||||
const int64_t kDurationUnlimited = 0;
|
||||
const int64_t kNoExpiration = LLONG_MAX;
|
||||
const int64_t kLicenseStartTime = 1413517500; // ~ 01/01/2013
|
||||
const int64_t kPlaybackStartTime = kLicenseStartTime + 5;
|
||||
const int64_t kRentalDuration = 604800; // 7 days
|
||||
const int64_t kPlaybackDuration = 172800; // 48 hours
|
||||
const int64_t kStreamingLicenseDuration = 300; // 5 minutes
|
||||
@@ -177,18 +178,19 @@ TEST_F(PolicyEngineTest, NoLicense) {
|
||||
TEST_F(PolicyEngineTest, PlaybackSuccess) {
|
||||
EXPECT_CALL(*mock_clock_, GetCurrentTime())
|
||||
.WillOnce(Return(kLicenseStartTime + 1))
|
||||
.WillOnce(Return(kLicenseStartTime + 5))
|
||||
.WillOnce(Return(kPlaybackStartTime))
|
||||
.WillOnce(Return(kLicenseStartTime + 10));
|
||||
|
||||
ExpectSessionKeysChange(kKeyStatusUsable, true);
|
||||
EXPECT_CALL(mock_event_listener_,
|
||||
OnExpirationUpdate(_, kLicenseStartTime + kLowDuration));
|
||||
EXPECT_CALL(mock_event_listener_,
|
||||
OnExpirationUpdate(_, kPlaybackStartTime + kPlaybackDuration));
|
||||
|
||||
policy_engine_->SetLicense(license_);
|
||||
|
||||
policy_engine_->BeginDecryption();
|
||||
policy_engine_->OnTimerEvent();
|
||||
|
||||
policy_engine_->BeginDecryption();
|
||||
EXPECT_TRUE(policy_engine_->CanDecrypt(kKeyId));
|
||||
EXPECT_FALSE(policy_engine_->CanDecrypt(kSomeRandomKeyId));
|
||||
}
|
||||
@@ -212,7 +214,7 @@ TEST_F(PolicyEngineTest, PlaybackFailed_CanPlayFalse) {
|
||||
EXPECT_FALSE(policy_engine_->CanDecrypt(kKeyId));
|
||||
}
|
||||
|
||||
TEST_F(PolicyEngineTest, PlaybackFails_RentalDurationExpired) {
|
||||
TEST_F(PolicyEngineTest, LicenseExpired_RentalDurationExpiredWithoutPlayback) {
|
||||
License_Policy* policy = license_.mutable_policy();
|
||||
policy->set_rental_duration_seconds(kLowDuration);
|
||||
policy->set_license_duration_seconds(kHighDuration);
|
||||
@@ -221,7 +223,7 @@ TEST_F(PolicyEngineTest, PlaybackFails_RentalDurationExpired) {
|
||||
|
||||
EXPECT_CALL(*mock_clock_, GetCurrentTime())
|
||||
.WillOnce(Return(kLicenseStartTime + 1))
|
||||
.WillOnce(Return(kLicenseStartTime + 5))
|
||||
.WillOnce(Return(kPlaybackStartTime))
|
||||
.WillOnce(Return(kLicenseStartTime + min_duration - 1))
|
||||
.WillOnce(Return(kLicenseStartTime + min_duration));
|
||||
|
||||
@@ -230,15 +232,14 @@ TEST_F(PolicyEngineTest, PlaybackFails_RentalDurationExpired) {
|
||||
EXPECT_CALL(mock_event_listener_,
|
||||
OnExpirationUpdate(_, kLicenseStartTime + kLowDuration));
|
||||
EXPECT_CALL(check_, Call(1));
|
||||
ExpectSessionKeysChange(kKeyStatusExpired, false);
|
||||
EXPECT_CALL(check_, Call(2));
|
||||
ExpectSessionKeysChange(kKeyStatusExpired, false);
|
||||
EXPECT_CALL(check_, Call(3));
|
||||
|
||||
policy_engine_->SetLicense(license_);
|
||||
|
||||
policy_engine_->BeginDecryption();
|
||||
EXPECT_TRUE(policy_engine_->CanDecrypt(kKeyId));
|
||||
|
||||
for (int i = 1; i <= 2; ++i) {
|
||||
for (int i = 1; i <= 3; ++i) {
|
||||
EXPECT_TRUE(policy_engine_->CanDecrypt(kKeyId));
|
||||
policy_engine_->OnTimerEvent();
|
||||
check_.Call(i);
|
||||
}
|
||||
@@ -246,6 +247,40 @@ TEST_F(PolicyEngineTest, PlaybackFails_RentalDurationExpired) {
|
||||
EXPECT_FALSE(policy_engine_->CanDecrypt(kKeyId));
|
||||
}
|
||||
|
||||
TEST_F(PolicyEngineTest, PlaybackOk_RentalDurationNotExpiredWithPlayback) {
|
||||
License_Policy* policy = license_.mutable_policy();
|
||||
policy->set_rental_duration_seconds(kLowDuration);
|
||||
policy->set_license_duration_seconds(kHighDuration);
|
||||
policy->set_renewal_delay_seconds(GetLicenseRenewalDelay(kHighDuration));
|
||||
int64_t min_duration = GetMinOfRentalPlaybackLicenseDurations();
|
||||
|
||||
EXPECT_CALL(*mock_clock_, GetCurrentTime())
|
||||
.WillOnce(Return(kLicenseStartTime + 1))
|
||||
.WillOnce(Return(kPlaybackStartTime))
|
||||
.WillOnce(Return(kLicenseStartTime + min_duration - 1))
|
||||
.WillOnce(Return(kLicenseStartTime + min_duration));
|
||||
|
||||
InSequence s;
|
||||
ExpectSessionKeysChange(kKeyStatusUsable, true);
|
||||
EXPECT_CALL(mock_event_listener_,
|
||||
OnExpirationUpdate(_, kLicenseStartTime + kLowDuration));
|
||||
EXPECT_CALL(mock_event_listener_,
|
||||
OnExpirationUpdate(_, kPlaybackStartTime + kPlaybackDuration));
|
||||
EXPECT_CALL(check_, Call(1));
|
||||
EXPECT_CALL(check_, Call(2));
|
||||
|
||||
policy_engine_->SetLicense(license_);
|
||||
policy_engine_->BeginDecryption();
|
||||
|
||||
for (int i = 1; i <= 2; ++i) {
|
||||
EXPECT_TRUE(policy_engine_->CanDecrypt(kKeyId));
|
||||
policy_engine_->OnTimerEvent();
|
||||
check_.Call(i);
|
||||
}
|
||||
|
||||
EXPECT_TRUE(policy_engine_->CanDecrypt(kKeyId));
|
||||
}
|
||||
|
||||
TEST_F(PolicyEngineTest, PlaybackFails_PlaybackDurationExpired) {
|
||||
License_Policy* policy = license_.mutable_policy();
|
||||
policy->set_license_duration_seconds(kHighDuration);
|
||||
@@ -269,11 +304,10 @@ TEST_F(PolicyEngineTest, PlaybackFails_PlaybackDurationExpired) {
|
||||
EXPECT_CALL(check_, Call(2));
|
||||
|
||||
policy_engine_->SetLicense(license_);
|
||||
|
||||
policy_engine_->BeginDecryption();
|
||||
EXPECT_TRUE(policy_engine_->CanDecrypt(kKeyId));
|
||||
|
||||
for (int i = 1; i <= 2; ++i) {
|
||||
EXPECT_TRUE(policy_engine_->CanDecrypt(kKeyId));
|
||||
policy_engine_->OnTimerEvent();
|
||||
check_.Call(i);
|
||||
}
|
||||
@@ -281,14 +315,14 @@ TEST_F(PolicyEngineTest, PlaybackFails_PlaybackDurationExpired) {
|
||||
EXPECT_FALSE(policy_engine_->CanDecrypt(kKeyId));
|
||||
}
|
||||
|
||||
TEST_F(PolicyEngineTest, PlaybackFails_LicenseDurationExpired) {
|
||||
TEST_F(PolicyEngineTest, LicenseExpired_LicenseDurationExpiredWithoutPlayback) {
|
||||
License_Policy* policy = license_.mutable_policy();
|
||||
policy->set_can_renew(false);
|
||||
int64_t min_duration = GetMinOfRentalPlaybackLicenseDurations();
|
||||
|
||||
EXPECT_CALL(*mock_clock_, GetCurrentTime())
|
||||
.WillOnce(Return(kLicenseStartTime + 1))
|
||||
.WillOnce(Return(kLicenseStartTime + 5))
|
||||
.WillOnce(Return(kPlaybackStartTime))
|
||||
.WillOnce(Return(kLicenseStartTime + min_duration - 1))
|
||||
.WillOnce(Return(kLicenseStartTime + min_duration));
|
||||
|
||||
@@ -297,15 +331,14 @@ TEST_F(PolicyEngineTest, PlaybackFails_LicenseDurationExpired) {
|
||||
EXPECT_CALL(mock_event_listener_,
|
||||
OnExpirationUpdate(_, kLicenseStartTime + kLowDuration));
|
||||
EXPECT_CALL(check_, Call(1));
|
||||
ExpectSessionKeysChange(kKeyStatusExpired, false);
|
||||
EXPECT_CALL(check_, Call(2));
|
||||
ExpectSessionKeysChange(kKeyStatusExpired, false);
|
||||
EXPECT_CALL(check_, Call(3));
|
||||
|
||||
policy_engine_->SetLicense(license_);
|
||||
|
||||
policy_engine_->BeginDecryption();
|
||||
EXPECT_TRUE(policy_engine_->CanDecrypt(kKeyId));
|
||||
|
||||
for (int i = 1; i <= 2; ++i) {
|
||||
for (int i = 1; i <= 3; ++i) {
|
||||
EXPECT_TRUE(policy_engine_->CanDecrypt(kKeyId));
|
||||
policy_engine_->OnTimerEvent();
|
||||
check_.Call(i);
|
||||
}
|
||||
@@ -313,6 +346,38 @@ TEST_F(PolicyEngineTest, PlaybackFails_LicenseDurationExpired) {
|
||||
EXPECT_FALSE(policy_engine_->CanDecrypt(kKeyId));
|
||||
}
|
||||
|
||||
TEST_F(PolicyEngineTest, PlaybackOk_LicenseDurationNotExpiredWithPlayback) {
|
||||
License_Policy* policy = license_.mutable_policy();
|
||||
policy->set_can_renew(false);
|
||||
int64_t min_duration = GetMinOfRentalPlaybackLicenseDurations();
|
||||
|
||||
EXPECT_CALL(*mock_clock_, GetCurrentTime())
|
||||
.WillOnce(Return(kLicenseStartTime + 1))
|
||||
.WillOnce(Return(kPlaybackStartTime))
|
||||
.WillOnce(Return(kLicenseStartTime + min_duration - 1))
|
||||
.WillOnce(Return(kLicenseStartTime + min_duration));
|
||||
|
||||
InSequence s;
|
||||
ExpectSessionKeysChange(kKeyStatusUsable, true);
|
||||
EXPECT_CALL(mock_event_listener_,
|
||||
OnExpirationUpdate(_, kLicenseStartTime + kLowDuration));
|
||||
EXPECT_CALL(mock_event_listener_,
|
||||
OnExpirationUpdate(_, kPlaybackStartTime + kPlaybackDuration));
|
||||
EXPECT_CALL(check_, Call(1));
|
||||
EXPECT_CALL(check_, Call(2));
|
||||
|
||||
policy_engine_->SetLicense(license_);
|
||||
policy_engine_->BeginDecryption();
|
||||
|
||||
for (int i = 1; i <= 2; ++i) {
|
||||
EXPECT_TRUE(policy_engine_->CanDecrypt(kKeyId));
|
||||
policy_engine_->OnTimerEvent();
|
||||
check_.Call(i);
|
||||
}
|
||||
|
||||
EXPECT_TRUE(policy_engine_->CanDecrypt(kKeyId));
|
||||
}
|
||||
|
||||
TEST_F(PolicyEngineTest, PlaybackFails_ExpiryBeforeRenewalDelay) {
|
||||
License_Policy* policy = license_.mutable_policy();
|
||||
policy->set_renewal_delay_seconds(kStreamingLicenseDuration + 10);
|
||||
@@ -320,24 +385,25 @@ TEST_F(PolicyEngineTest, PlaybackFails_ExpiryBeforeRenewalDelay) {
|
||||
|
||||
EXPECT_CALL(*mock_clock_, GetCurrentTime())
|
||||
.WillOnce(Return(kLicenseStartTime + 1))
|
||||
.WillOnce(Return(kLicenseStartTime + 5))
|
||||
.WillOnce(Return(kPlaybackStartTime))
|
||||
.WillOnce(Return(kLicenseStartTime + min_duration - 1))
|
||||
.WillOnce(Return(kLicenseStartTime + min_duration));
|
||||
.WillOnce(Return(kPlaybackStartTime + kPlaybackDuration));
|
||||
|
||||
InSequence s;
|
||||
ExpectSessionKeysChange(kKeyStatusUsable, true);
|
||||
EXPECT_CALL(mock_event_listener_,
|
||||
OnExpirationUpdate(_, kLicenseStartTime + kLowDuration));
|
||||
EXPECT_CALL(mock_event_listener_,
|
||||
OnExpirationUpdate(_, kPlaybackStartTime + kPlaybackDuration));
|
||||
EXPECT_CALL(check_, Call(1));
|
||||
ExpectSessionKeysChange(kKeyStatusExpired, false);
|
||||
EXPECT_CALL(check_, Call(2));
|
||||
|
||||
policy_engine_->SetLicense(license_);
|
||||
|
||||
policy_engine_->BeginDecryption();
|
||||
EXPECT_TRUE(policy_engine_->CanDecrypt(kKeyId));
|
||||
|
||||
for (int i = 1; i <= 2; ++i) {
|
||||
EXPECT_TRUE(policy_engine_->CanDecrypt(kKeyId));
|
||||
policy_engine_->OnTimerEvent();
|
||||
check_.Call(i);
|
||||
}
|
||||
@@ -353,16 +419,18 @@ TEST_F(PolicyEngineTest, PlaybackOk_RentalDuration0) {
|
||||
|
||||
EXPECT_CALL(*mock_clock_, GetCurrentTime())
|
||||
.WillOnce(Return(kLicenseStartTime + 1))
|
||||
.WillOnce(Return(kLicenseStartTime + 5))
|
||||
.WillOnce(Return(kPlaybackStartTime))
|
||||
.WillOnce(Return(kLicenseStartTime + license_renewal_delay - 1))
|
||||
.WillOnce(Return(kLicenseStartTime + license_renewal_delay))
|
||||
.WillOnce(Return(kLicenseStartTime + kStreamingLicenseDuration - 1))
|
||||
.WillOnce(Return(kLicenseStartTime + kStreamingLicenseDuration));
|
||||
.WillOnce(Return(kPlaybackStartTime + kPlaybackDuration));
|
||||
|
||||
InSequence s;
|
||||
ExpectSessionKeysChange(kKeyStatusUsable, true);
|
||||
EXPECT_CALL(mock_event_listener_,
|
||||
OnExpirationUpdate(_, kLicenseStartTime + kLowDuration));
|
||||
EXPECT_CALL(mock_event_listener_,
|
||||
OnExpirationUpdate(_, kPlaybackStartTime + kPlaybackDuration));
|
||||
EXPECT_CALL(check_, Call(1));
|
||||
EXPECT_CALL(mock_event_listener_, OnSessionRenewalNeeded(_));
|
||||
EXPECT_CALL(check_, Call(2));
|
||||
@@ -372,11 +440,10 @@ TEST_F(PolicyEngineTest, PlaybackOk_RentalDuration0) {
|
||||
EXPECT_CALL(check_, Call(4));
|
||||
|
||||
policy_engine_->SetLicense(license_);
|
||||
|
||||
policy_engine_->BeginDecryption();
|
||||
EXPECT_TRUE(policy_engine_->CanDecrypt(kKeyId));
|
||||
|
||||
for (int i = 1; i <= 4; ++i) {
|
||||
EXPECT_TRUE(policy_engine_->CanDecrypt(kKeyId));
|
||||
policy_engine_->OnTimerEvent();
|
||||
check_.Call(i);
|
||||
}
|
||||
@@ -393,7 +460,7 @@ TEST_F(PolicyEngineTest, PlaybackOk_PlaybackDuration0) {
|
||||
|
||||
EXPECT_CALL(*mock_clock_, GetCurrentTime())
|
||||
.WillOnce(Return(kLicenseStartTime))
|
||||
.WillOnce(Return(kLicenseStartTime + 5))
|
||||
.WillOnce(Return(kPlaybackStartTime))
|
||||
.WillOnce(Return(kLicenseStartTime + license_renewal_delay - 2))
|
||||
.WillOnce(Return(kLicenseStartTime + license_renewal_delay + 2))
|
||||
.WillOnce(Return(kLicenseStartTime + kHighDuration - 2))
|
||||
@@ -403,54 +470,60 @@ TEST_F(PolicyEngineTest, PlaybackOk_PlaybackDuration0) {
|
||||
ExpectSessionKeysChange(kKeyStatusUsable, true);
|
||||
EXPECT_CALL(mock_event_listener_,
|
||||
OnExpirationUpdate(_, kLicenseStartTime + kHighDuration));
|
||||
EXPECT_CALL(mock_event_listener_,
|
||||
OnExpirationUpdate(_, kNoExpiration));
|
||||
EXPECT_CALL(check_, Call(1));
|
||||
EXPECT_CALL(mock_event_listener_, OnSessionRenewalNeeded(_));
|
||||
EXPECT_CALL(check_, Call(2));
|
||||
EXPECT_CALL(mock_event_listener_, OnSessionRenewalNeeded(_));
|
||||
EXPECT_CALL(check_, Call(3));
|
||||
ExpectSessionKeysChange(kKeyStatusExpired, false);
|
||||
EXPECT_CALL(check_, Call(4));
|
||||
|
||||
policy_engine_->SetLicense(license_);
|
||||
|
||||
policy_engine_->BeginDecryption();
|
||||
EXPECT_TRUE(policy_engine_->CanDecrypt(kKeyId));
|
||||
|
||||
for (int i = 1; i <= 4; ++i) {
|
||||
EXPECT_TRUE(policy_engine_->CanDecrypt(kKeyId));
|
||||
policy_engine_->OnTimerEvent();
|
||||
check_.Call(i);
|
||||
}
|
||||
|
||||
EXPECT_FALSE(policy_engine_->CanDecrypt(kKeyId));
|
||||
EXPECT_TRUE(policy_engine_->CanDecrypt(kKeyId));
|
||||
}
|
||||
|
||||
TEST_F(PolicyEngineTest, PlaybackOk_LicenseDuration0) {
|
||||
License_Policy* policy = license_.mutable_policy();
|
||||
policy->set_license_duration_seconds(kDurationUnlimited);
|
||||
policy->set_rental_duration_seconds(kLowDuration);
|
||||
policy->set_renewal_delay_seconds(GetLicenseRenewalDelay(kHighDuration));
|
||||
int64_t license_renewal_delay = GetLicenseRenewalDelay(kLowDuration);
|
||||
policy->set_renewal_delay_seconds(license_renewal_delay);
|
||||
int64_t min_duration = GetMinOfRentalPlaybackLicenseDurations();
|
||||
|
||||
EXPECT_CALL(*mock_clock_, GetCurrentTime())
|
||||
.WillOnce(Return(kLicenseStartTime + 1))
|
||||
.WillOnce(Return(kLicenseStartTime + 5))
|
||||
.WillOnce(Return(kPlaybackStartTime))
|
||||
.WillOnce(Return(kLicenseStartTime + license_renewal_delay - 1))
|
||||
.WillOnce(Return(kLicenseStartTime + min_duration - 1))
|
||||
.WillOnce(Return(kLicenseStartTime + min_duration));
|
||||
.WillOnce(Return(kLicenseStartTime + kPlaybackStartTime +
|
||||
kPlaybackDuration));
|
||||
|
||||
InSequence s;
|
||||
ExpectSessionKeysChange(kKeyStatusUsable, true);
|
||||
EXPECT_CALL(mock_event_listener_,
|
||||
OnExpirationUpdate(_, kLicenseStartTime + kLowDuration));
|
||||
EXPECT_CALL(mock_event_listener_,
|
||||
OnExpirationUpdate(_, kPlaybackStartTime + kPlaybackDuration));
|
||||
EXPECT_CALL(check_, Call(1));
|
||||
ExpectSessionKeysChange(kKeyStatusExpired, false);
|
||||
EXPECT_CALL(mock_event_listener_, OnSessionRenewalNeeded(_));
|
||||
EXPECT_CALL(check_, Call(2));
|
||||
ExpectSessionKeysChange(kKeyStatusExpired, false);
|
||||
EXPECT_CALL(check_, Call(3));
|
||||
|
||||
policy_engine_->SetLicense(license_);
|
||||
|
||||
policy_engine_->BeginDecryption();
|
||||
EXPECT_TRUE(policy_engine_->CanDecrypt(kKeyId));
|
||||
|
||||
for (int i = 1; i <= 2; ++i) {
|
||||
for (int i = 1; i <= 3; ++i) {
|
||||
EXPECT_TRUE(policy_engine_->CanDecrypt(kKeyId));
|
||||
policy_engine_->OnTimerEvent();
|
||||
check_.Call(i);
|
||||
}
|
||||
@@ -467,7 +540,7 @@ TEST_F(PolicyEngineTest, PlaybackOk_Durations0) {
|
||||
|
||||
EXPECT_CALL(*mock_clock_, GetCurrentTime())
|
||||
.WillOnce(Return(kLicenseStartTime + 1))
|
||||
.WillOnce(Return(kLicenseStartTime + 5))
|
||||
.WillOnce(Return(kPlaybackStartTime))
|
||||
.WillOnce(Return(kLicenseStartTime + kHighDuration - 1))
|
||||
.WillOnce(Return(kLicenseStartTime + kHighDuration));
|
||||
|
||||
@@ -490,13 +563,15 @@ TEST_F(PolicyEngineTest, PlaybackOk_LicenseWithFutureStartTime) {
|
||||
.WillOnce(Return(kLicenseStartTime - 100))
|
||||
.WillOnce(Return(kLicenseStartTime - 50))
|
||||
.WillOnce(Return(kLicenseStartTime))
|
||||
.WillOnce(Return(kLicenseStartTime + 10));
|
||||
.WillOnce(Return(kPlaybackStartTime));
|
||||
|
||||
InSequence s;
|
||||
ExpectSessionKeysChange(kKeyStatusPending, false);
|
||||
EXPECT_CALL(mock_event_listener_,
|
||||
OnExpirationUpdate(_, kLicenseStartTime + kLowDuration));
|
||||
ExpectSessionKeysChange(kKeyStatusUsable, true);
|
||||
EXPECT_CALL(mock_event_listener_,
|
||||
OnExpirationUpdate(_, kPlaybackStartTime + kPlaybackDuration));
|
||||
|
||||
policy_engine_->SetLicense(license_);
|
||||
|
||||
@@ -518,26 +593,28 @@ TEST_F(PolicyEngineTest, PlaybackFailed_CanRenewFalse) {
|
||||
|
||||
EXPECT_CALL(*mock_clock_, GetCurrentTime())
|
||||
.WillOnce(Return(kLicenseStartTime + 1))
|
||||
.WillOnce(Return(kLicenseStartTime + 5))
|
||||
.WillOnce(Return(kPlaybackStartTime))
|
||||
.WillOnce(Return(kLicenseStartTime + license_renewal_delay - 10))
|
||||
.WillOnce(Return(kLicenseStartTime + license_renewal_delay + 10))
|
||||
.WillOnce(Return(kLicenseStartTime + kStreamingLicenseDuration + 10));
|
||||
.WillOnce(Return(kLicenseStartTime + kStreamingLicenseDuration + 10))
|
||||
.WillOnce(Return(kLicenseStartTime + kPlaybackStartTime +
|
||||
kPlaybackDuration));
|
||||
|
||||
InSequence s;
|
||||
ExpectSessionKeysChange(kKeyStatusUsable, true);
|
||||
EXPECT_CALL(mock_event_listener_,
|
||||
OnExpirationUpdate(_, kLicenseStartTime + kLowDuration));
|
||||
EXPECT_CALL(mock_event_listener_,
|
||||
OnExpirationUpdate(_, kPlaybackStartTime + kPlaybackDuration));
|
||||
EXPECT_CALL(check_, Call(1));
|
||||
EXPECT_CALL(check_, Call(2));
|
||||
ExpectSessionKeysChange(kKeyStatusExpired, false);
|
||||
EXPECT_CALL(check_, Call(3));
|
||||
|
||||
policy_engine_->SetLicense(license_);
|
||||
|
||||
policy_engine_->BeginDecryption();
|
||||
EXPECT_TRUE(policy_engine_->CanDecrypt(kKeyId));
|
||||
|
||||
for (int i = 1; i <= 3; ++i) {
|
||||
EXPECT_TRUE(policy_engine_->CanDecrypt(kKeyId));
|
||||
policy_engine_->OnTimerEvent();
|
||||
check_.Call(i);
|
||||
}
|
||||
@@ -553,7 +630,7 @@ TEST_F(PolicyEngineTest, PlaybackOk_RenewSuccess) {
|
||||
|
||||
EXPECT_CALL(*mock_clock_, GetCurrentTime())
|
||||
.WillOnce(Return(kLicenseStartTime + 1))
|
||||
.WillOnce(Return(kLicenseStartTime + 5))
|
||||
.WillOnce(Return(kPlaybackStartTime))
|
||||
.WillOnce(Return(kLicenseStartTime + license_renewal_delay - 15))
|
||||
.WillOnce(Return(kLicenseStartTime + license_renewal_delay + 10))
|
||||
.WillOnce(Return(kLicenseStartTime + license_renewal_delay + 20))
|
||||
@@ -564,19 +641,18 @@ TEST_F(PolicyEngineTest, PlaybackOk_RenewSuccess) {
|
||||
ExpectSessionKeysChange(kKeyStatusUsable, true);
|
||||
EXPECT_CALL(mock_event_listener_,
|
||||
OnExpirationUpdate(_, kLicenseStartTime + kLowDuration));
|
||||
EXPECT_CALL(mock_event_listener_,
|
||||
OnExpirationUpdate(_, kPlaybackStartTime + kPlaybackDuration));
|
||||
EXPECT_CALL(check_, Call(1));
|
||||
EXPECT_CALL(mock_event_listener_, OnSessionRenewalNeeded(_));
|
||||
EXPECT_CALL(check_, Call(2));
|
||||
EXPECT_CALL(mock_event_listener_,
|
||||
OnExpirationUpdate(_, new_license_start_time + kLowDuration));
|
||||
EXPECT_CALL(check_, Call(3));
|
||||
|
||||
policy_engine_->SetLicense(license_);
|
||||
|
||||
policy_engine_->BeginDecryption();
|
||||
EXPECT_TRUE(policy_engine_->CanDecrypt(kKeyId));
|
||||
|
||||
for (int i = 1; i <= 2; ++i) {
|
||||
EXPECT_TRUE(policy_engine_->CanDecrypt(kKeyId));
|
||||
policy_engine_->OnTimerEvent();
|
||||
check_.Call(i);
|
||||
}
|
||||
@@ -602,7 +678,7 @@ TEST_F(PolicyEngineTest, PlaybackOk_RenewSuccess_WithFutureStartTime) {
|
||||
|
||||
EXPECT_CALL(*mock_clock_, GetCurrentTime())
|
||||
.WillOnce(Return(kLicenseStartTime + 1))
|
||||
.WillOnce(Return(kLicenseStartTime + 5))
|
||||
.WillOnce(Return(kPlaybackStartTime))
|
||||
.WillOnce(Return(kLicenseStartTime + license_renewal_delay - 15))
|
||||
.WillOnce(Return(kLicenseStartTime + license_renewal_delay + 10))
|
||||
.WillOnce(Return(kLicenseStartTime + license_renewal_delay + 20))
|
||||
@@ -613,22 +689,21 @@ TEST_F(PolicyEngineTest, PlaybackOk_RenewSuccess_WithFutureStartTime) {
|
||||
ExpectSessionKeysChange(kKeyStatusUsable, true);
|
||||
EXPECT_CALL(mock_event_listener_,
|
||||
OnExpirationUpdate(_, kLicenseStartTime + kLowDuration));
|
||||
EXPECT_CALL(mock_event_listener_,
|
||||
OnExpirationUpdate(_, kPlaybackStartTime + kPlaybackDuration));
|
||||
EXPECT_CALL(check_, Call(1));
|
||||
EXPECT_CALL(mock_event_listener_, OnSessionRenewalNeeded(_));
|
||||
EXPECT_CALL(check_, Call(2));
|
||||
ExpectSessionKeysChange(kKeyStatusPending, false);
|
||||
EXPECT_CALL(mock_event_listener_,
|
||||
OnExpirationUpdate(_, new_license_start_time + kLowDuration));
|
||||
EXPECT_CALL(check_, Call(3));
|
||||
ExpectSessionKeysChange(kKeyStatusUsable, true);
|
||||
EXPECT_CALL(check_, Call(4));
|
||||
|
||||
policy_engine_->SetLicense(license_);
|
||||
|
||||
policy_engine_->BeginDecryption();
|
||||
EXPECT_TRUE(policy_engine_->CanDecrypt(kKeyId));
|
||||
|
||||
for (int i = 1; i <= 2; ++i) {
|
||||
EXPECT_TRUE(policy_engine_->CanDecrypt(kKeyId));
|
||||
policy_engine_->OnTimerEvent();
|
||||
check_.Call(i);
|
||||
}
|
||||
@@ -648,13 +723,12 @@ TEST_F(PolicyEngineTest, PlaybackOk_RenewSuccess_WithFutureStartTime) {
|
||||
EXPECT_TRUE(policy_engine_->CanDecrypt(kKeyId));
|
||||
}
|
||||
|
||||
TEST_F(PolicyEngineTest, PlaybackFailed_RenewFailedVersionNotUpdated) {
|
||||
TEST_F(PolicyEngineTest, LicenseExpired_RenewFailedVersionNotUpdated) {
|
||||
int64_t license_renewal_delay =
|
||||
GetLicenseRenewalDelay(kStreamingLicenseDuration);
|
||||
|
||||
EXPECT_CALL(*mock_clock_, GetCurrentTime())
|
||||
.WillOnce(Return(kLicenseStartTime + 1))
|
||||
.WillOnce(Return(kLicenseStartTime + 5))
|
||||
.WillOnce(Return(kLicenseStartTime + license_renewal_delay - 10))
|
||||
.WillOnce(Return(kLicenseStartTime + license_renewal_delay + 10))
|
||||
.WillOnce(Return(kLicenseStartTime + license_renewal_delay + 40))
|
||||
@@ -674,10 +748,8 @@ TEST_F(PolicyEngineTest, PlaybackFailed_RenewFailedVersionNotUpdated) {
|
||||
|
||||
policy_engine_->SetLicense(license_);
|
||||
|
||||
policy_engine_->BeginDecryption();
|
||||
EXPECT_TRUE(policy_engine_->CanDecrypt(kKeyId));
|
||||
|
||||
for (int i = 1; i <= 2; ++i) {
|
||||
EXPECT_TRUE(policy_engine_->CanDecrypt(kKeyId));
|
||||
policy_engine_->OnTimerEvent();
|
||||
check_.Call(i);
|
||||
}
|
||||
@@ -685,7 +757,7 @@ TEST_F(PolicyEngineTest, PlaybackFailed_RenewFailedVersionNotUpdated) {
|
||||
EXPECT_TRUE(policy_engine_->CanDecrypt(kKeyId));
|
||||
|
||||
license_.set_license_start_time(kLicenseStartTime + license_renewal_delay +
|
||||
15);
|
||||
30);
|
||||
policy_engine_->UpdateLicense(license_);
|
||||
|
||||
policy_engine_->OnTimerEvent();
|
||||
@@ -705,20 +777,22 @@ TEST_F(PolicyEngineTest, PlaybackFailed_RepeatedRenewFailures) {
|
||||
|
||||
EXPECT_CALL(*mock_clock_, GetCurrentTime())
|
||||
.WillOnce(Return(kLicenseStartTime + 1))
|
||||
.WillOnce(Return(kLicenseStartTime + 5))
|
||||
.WillOnce(Return(kPlaybackStartTime))
|
||||
.WillOnce(Return(kLicenseStartTime + license_renewal_delay - 10))
|
||||
.WillOnce(Return(kLicenseStartTime + license_renewal_delay + 10))
|
||||
.WillOnce(Return(kLicenseStartTime + license_renewal_delay + 20))
|
||||
.WillOnce(Return(kLicenseStartTime + license_renewal_delay + 40))
|
||||
.WillOnce(Return(kLicenseStartTime + license_renewal_delay + 50))
|
||||
.WillOnce(Return(kLicenseStartTime + license_renewal_delay + 70))
|
||||
.WillOnce(Return(kLicenseStartTime + license_renewal_delay + 80))
|
||||
.WillOnce(Return(kLicenseStartTime + kStreamingLicenseDuration + 15));
|
||||
.WillOnce(Return(kLicenseStartTime + kStreamingLicenseDuration + 15))
|
||||
.WillOnce(Return(kPlaybackStartTime + kPlaybackDuration));
|
||||
|
||||
InSequence s;
|
||||
ExpectSessionKeysChange(kKeyStatusUsable, true);
|
||||
EXPECT_CALL(mock_event_listener_,
|
||||
OnExpirationUpdate(_, kLicenseStartTime + kLowDuration));
|
||||
EXPECT_CALL(mock_event_listener_,
|
||||
OnExpirationUpdate(_, kPlaybackStartTime + kPlaybackDuration));
|
||||
EXPECT_CALL(check_, Call(1));
|
||||
EXPECT_CALL(mock_event_listener_, OnSessionRenewalNeeded(_));
|
||||
EXPECT_CALL(check_, Call(2));
|
||||
@@ -728,12 +802,12 @@ TEST_F(PolicyEngineTest, PlaybackFailed_RepeatedRenewFailures) {
|
||||
EXPECT_CALL(check_, Call(5));
|
||||
EXPECT_CALL(mock_event_listener_, OnSessionRenewalNeeded(_));
|
||||
EXPECT_CALL(check_, Call(6));
|
||||
EXPECT_CALL(mock_event_listener_, OnSessionRenewalNeeded(_));
|
||||
EXPECT_CALL(check_, Call(7));
|
||||
ExpectSessionKeysChange(kKeyStatusExpired, false);
|
||||
EXPECT_CALL(check_, Call(8));
|
||||
|
||||
policy_engine_->SetLicense(license_);
|
||||
|
||||
policy_engine_->BeginDecryption();
|
||||
|
||||
for (int i = 1; i <= 8; ++i) {
|
||||
@@ -747,14 +821,13 @@ TEST_F(PolicyEngineTest, PlaybackFailed_RepeatedRenewFailures) {
|
||||
TEST_F(PolicyEngineTest, PlaybackOk_RenewSuccessAfterExpiry) {
|
||||
int64_t license_renewal_delay =
|
||||
GetLicenseRenewalDelay(kStreamingLicenseDuration);
|
||||
int64_t new_license_start_time =
|
||||
kLicenseStartTime + kStreamingLicenseDuration + 20;
|
||||
int64_t new_license_start_time = kPlaybackStartTime + kPlaybackDuration + 10;
|
||||
int64_t new_playback_duration = kPlaybackDuration + 100;
|
||||
int64_t new_license_duration = kStreamingLicenseDuration + 100;
|
||||
|
||||
EXPECT_CALL(*mock_clock_, GetCurrentTime())
|
||||
.WillOnce(Return(kLicenseStartTime + 1))
|
||||
.WillOnce(Return(kLicenseStartTime + 5))
|
||||
.WillOnce(Return(kPlaybackStartTime))
|
||||
.WillOnce(Return(kLicenseStartTime + license_renewal_delay - 10))
|
||||
.WillOnce(Return(kLicenseStartTime + license_renewal_delay + 10))
|
||||
.WillOnce(Return(kLicenseStartTime + license_renewal_delay + 20))
|
||||
@@ -763,13 +836,16 @@ TEST_F(PolicyEngineTest, PlaybackOk_RenewSuccessAfterExpiry) {
|
||||
.WillOnce(Return(kLicenseStartTime + license_renewal_delay + 70))
|
||||
.WillOnce(Return(kLicenseStartTime + license_renewal_delay + 80))
|
||||
.WillOnce(Return(kLicenseStartTime + kStreamingLicenseDuration + 10))
|
||||
.WillOnce(Return(kLicenseStartTime + kStreamingLicenseDuration + 30))
|
||||
.WillOnce(Return(kLicenseStartTime + kStreamingLicenseDuration + 40));
|
||||
.WillOnce(Return(kPlaybackStartTime + kPlaybackDuration))
|
||||
.WillOnce(Return(new_license_start_time))
|
||||
.WillOnce(Return(kPlaybackStartTime + kPlaybackDuration + 20));
|
||||
|
||||
InSequence s;
|
||||
ExpectSessionKeysChange(kKeyStatusUsable, true);
|
||||
EXPECT_CALL(mock_event_listener_,
|
||||
OnExpirationUpdate(_, kLicenseStartTime + kLowDuration));
|
||||
EXPECT_CALL(mock_event_listener_,
|
||||
OnExpirationUpdate(_, kPlaybackStartTime + kPlaybackDuration));
|
||||
EXPECT_CALL(check_, Call(1));
|
||||
EXPECT_CALL(mock_event_listener_, OnSessionRenewalNeeded(_));
|
||||
EXPECT_CALL(check_, Call(2));
|
||||
@@ -780,19 +856,20 @@ TEST_F(PolicyEngineTest, PlaybackOk_RenewSuccessAfterExpiry) {
|
||||
EXPECT_CALL(mock_event_listener_, OnSessionRenewalNeeded(_));
|
||||
EXPECT_CALL(check_, Call(6));
|
||||
EXPECT_CALL(check_, Call(7));
|
||||
ExpectSessionKeysChange(kKeyStatusExpired, false);
|
||||
EXPECT_CALL(mock_event_listener_, OnSessionRenewalNeeded(_));
|
||||
EXPECT_CALL(check_, Call(8));
|
||||
ExpectSessionKeysChange(kKeyStatusExpired, false);
|
||||
EXPECT_CALL(check_, Call(9));
|
||||
ExpectSessionKeysChange(kKeyStatusUsable, true);
|
||||
EXPECT_CALL(
|
||||
mock_event_listener_,
|
||||
OnExpirationUpdate(_, new_license_start_time + new_license_duration));
|
||||
EXPECT_CALL(check_, Call(9));
|
||||
OnExpirationUpdate(_, kPlaybackStartTime + new_playback_duration));
|
||||
EXPECT_CALL(check_, Call(10));
|
||||
|
||||
policy_engine_->SetLicense(license_);
|
||||
|
||||
policy_engine_->BeginDecryption();
|
||||
|
||||
for (int i = 1; i <= 8; ++i) {
|
||||
for (int i = 1; i <= 9; ++i) {
|
||||
EXPECT_TRUE(policy_engine_->CanDecrypt(kKeyId));
|
||||
policy_engine_->OnTimerEvent();
|
||||
check_.Call(i);
|
||||
@@ -803,14 +880,13 @@ TEST_F(PolicyEngineTest, PlaybackOk_RenewSuccessAfterExpiry) {
|
||||
LicenseIdentification* id = license_.mutable_id();
|
||||
id->set_version(2);
|
||||
License_Policy* policy = license_.mutable_policy();
|
||||
policy = license_.mutable_policy();
|
||||
policy->set_playback_duration_seconds(new_playback_duration);
|
||||
policy->set_license_duration_seconds(new_license_duration);
|
||||
|
||||
policy_engine_->UpdateLicense(license_);
|
||||
|
||||
policy_engine_->OnTimerEvent();
|
||||
check_.Call(9);
|
||||
check_.Call(10);
|
||||
|
||||
EXPECT_TRUE(policy_engine_->CanDecrypt(kKeyId));
|
||||
}
|
||||
@@ -820,6 +896,7 @@ TEST_F(PolicyEngineTest, PlaybackOk_RenewSuccessAfterFailures) {
|
||||
GetLicenseRenewalDelay(kStreamingLicenseDuration);
|
||||
int64_t new_license_start_time =
|
||||
kLicenseStartTime + license_renewal_delay + 55;
|
||||
int64_t new_playback_duration = kPlaybackDuration + 100;
|
||||
|
||||
EXPECT_CALL(*mock_clock_, GetCurrentTime())
|
||||
.WillOnce(Return(kLicenseStartTime + 1))
|
||||
@@ -837,6 +914,8 @@ TEST_F(PolicyEngineTest, PlaybackOk_RenewSuccessAfterFailures) {
|
||||
ExpectSessionKeysChange(kKeyStatusUsable, true);
|
||||
EXPECT_CALL(mock_event_listener_,
|
||||
OnExpirationUpdate(_, kLicenseStartTime + kLowDuration));
|
||||
EXPECT_CALL(mock_event_listener_,
|
||||
OnExpirationUpdate(_, kPlaybackStartTime + kPlaybackDuration));
|
||||
EXPECT_CALL(check_, Call(1));
|
||||
EXPECT_CALL(mock_event_listener_, OnSessionRenewalNeeded(_));
|
||||
EXPECT_CALL(check_, Call(2));
|
||||
@@ -844,13 +923,13 @@ TEST_F(PolicyEngineTest, PlaybackOk_RenewSuccessAfterFailures) {
|
||||
EXPECT_CALL(mock_event_listener_, OnSessionRenewalNeeded(_));
|
||||
EXPECT_CALL(check_, Call(4));
|
||||
EXPECT_CALL(check_, Call(5));
|
||||
EXPECT_CALL(mock_event_listener_,
|
||||
OnExpirationUpdate(_, new_license_start_time + kLowDuration));
|
||||
EXPECT_CALL(
|
||||
mock_event_listener_,
|
||||
OnExpirationUpdate(_, kPlaybackStartTime + new_playback_duration));
|
||||
EXPECT_CALL(check_, Call(6));
|
||||
EXPECT_CALL(check_, Call(7));
|
||||
|
||||
policy_engine_->SetLicense(license_);
|
||||
|
||||
policy_engine_->BeginDecryption();
|
||||
|
||||
for (int i = 1; i <= 5; ++i) {
|
||||
@@ -862,38 +941,45 @@ TEST_F(PolicyEngineTest, PlaybackOk_RenewSuccessAfterFailures) {
|
||||
license_.set_license_start_time(new_license_start_time);
|
||||
LicenseIdentification* id = license_.mutable_id();
|
||||
id->set_version(2);
|
||||
license_.mutable_policy()->set_playback_duration_seconds(
|
||||
new_playback_duration);
|
||||
policy_engine_->UpdateLicense(license_);
|
||||
|
||||
for (int i = 6; i <= 7; ++i) {
|
||||
EXPECT_TRUE(policy_engine_->CanDecrypt(kKeyId));
|
||||
policy_engine_->OnTimerEvent();
|
||||
check_.Call(i);
|
||||
EXPECT_TRUE(policy_engine_->CanDecrypt(kKeyId));
|
||||
}
|
||||
EXPECT_TRUE(policy_engine_->CanDecrypt(kKeyId));
|
||||
}
|
||||
|
||||
TEST_F(PolicyEngineTest, PlaybackOk_RenewedWithUsage) {
|
||||
int64_t new_license_start_time = kLicenseStartTime + 30;
|
||||
int64_t new_license_start_time = kLicenseStartTime + 10;
|
||||
int64_t new_playback_duration = kPlaybackDuration + 100;
|
||||
|
||||
License_Policy* policy = license_.mutable_policy();
|
||||
policy->set_renew_with_usage(true);
|
||||
|
||||
EXPECT_CALL(*mock_clock_, GetCurrentTime())
|
||||
.WillOnce(Return(kLicenseStartTime + 1))
|
||||
.WillOnce(Return(kLicenseStartTime + 5))
|
||||
.WillOnce(Return(kLicenseStartTime + 3))
|
||||
.WillOnce(Return(kPlaybackStartTime))
|
||||
.WillOnce(Return(kLicenseStartTime + 10))
|
||||
.WillOnce(Return(kLicenseStartTime + 20))
|
||||
.WillOnce(Return(kLicenseStartTime + 40))
|
||||
.WillOnce(Return(kLicenseStartTime + 50));
|
||||
.WillOnce(Return(kLicenseStartTime + 40));
|
||||
|
||||
InSequence s;
|
||||
ExpectSessionKeysChange(kKeyStatusUsable, true);
|
||||
EXPECT_CALL(mock_event_listener_,
|
||||
OnExpirationUpdate(_, kLicenseStartTime + kLowDuration));
|
||||
EXPECT_CALL(check_, Call(1));
|
||||
EXPECT_CALL(mock_event_listener_,
|
||||
OnExpirationUpdate(_, kPlaybackStartTime + kPlaybackDuration));
|
||||
EXPECT_CALL(mock_event_listener_, OnSessionRenewalNeeded(_));
|
||||
EXPECT_CALL(check_, Call(2));
|
||||
EXPECT_CALL(mock_event_listener_,
|
||||
OnExpirationUpdate(_, new_license_start_time + kLowDuration));
|
||||
EXPECT_CALL(
|
||||
mock_event_listener_,
|
||||
OnExpirationUpdate(_, kPlaybackStartTime + new_playback_duration));
|
||||
EXPECT_CALL(check_, Call(3));
|
||||
|
||||
policy_engine_->SetLicense(license_);
|
||||
@@ -908,6 +994,8 @@ TEST_F(PolicyEngineTest, PlaybackOk_RenewedWithUsage) {
|
||||
check_.Call(2);
|
||||
|
||||
license_.set_license_start_time(new_license_start_time);
|
||||
license_.mutable_policy()->set_playback_duration_seconds(
|
||||
new_playback_duration);
|
||||
policy->set_renew_with_usage(false);
|
||||
LicenseIdentification* id = license_.mutable_id();
|
||||
id->set_version(2);
|
||||
@@ -1305,7 +1393,7 @@ TEST_F(PolicyEngineQueryTest, QuerySuccess_RentalDurationExpired) {
|
||||
int64_t min_duration = GetMinOfRentalPlaybackLicenseDurations();
|
||||
EXPECT_CALL(*mock_clock_, GetCurrentTime())
|
||||
.WillOnce(Return(kLicenseStartTime + 1))
|
||||
.WillOnce(Return(kLicenseStartTime + 5))
|
||||
.WillOnce(Return(kPlaybackStartTime))
|
||||
.WillOnce(Return(kLicenseStartTime + min_duration - 1))
|
||||
.WillOnce(Return(kLicenseStartTime + min_duration))
|
||||
.WillOnce(Return(kLicenseStartTime + min_duration + 5));
|
||||
@@ -1319,7 +1407,7 @@ TEST_F(PolicyEngineQueryTest, QuerySuccess_RentalDurationExpired) {
|
||||
policy_engine_->OnTimerEvent();
|
||||
}
|
||||
|
||||
EXPECT_FALSE(policy_engine_->CanDecrypt(kKeyId));
|
||||
EXPECT_TRUE(policy_engine_->CanDecrypt(kKeyId));
|
||||
|
||||
CdmQueryMap query_info;
|
||||
EXPECT_EQ(NO_ERROR, policy_engine_->Query(&query_info));
|
||||
@@ -1406,7 +1494,7 @@ TEST_F(PolicyEngineQueryTest, QuerySuccess_LicenseDurationExpired) {
|
||||
policy_engine_->OnTimerEvent();
|
||||
}
|
||||
|
||||
EXPECT_FALSE(policy_engine_->CanDecrypt(kKeyId));
|
||||
EXPECT_TRUE(policy_engine_->CanDecrypt(kKeyId));
|
||||
|
||||
CdmQueryMap query_info;
|
||||
EXPECT_EQ(NO_ERROR, policy_engine_->Query(&query_info));
|
||||
@@ -1451,7 +1539,7 @@ TEST_F(PolicyEngineQueryTest, QuerySuccess_RentalDuration0) {
|
||||
policy_engine_->OnTimerEvent();
|
||||
}
|
||||
|
||||
EXPECT_FALSE(policy_engine_->CanDecrypt(kKeyId));
|
||||
EXPECT_TRUE(policy_engine_->CanDecrypt(kKeyId));
|
||||
|
||||
CdmQueryMap query_info;
|
||||
EXPECT_EQ(NO_ERROR, policy_engine_->Query(&query_info));
|
||||
@@ -1520,7 +1608,7 @@ TEST_F(PolicyEngineQueryTest, QuerySuccess_PlaybackDuration0) {
|
||||
policy_engine_->OnTimerEvent();
|
||||
}
|
||||
|
||||
EXPECT_FALSE(policy_engine_->CanDecrypt(kKeyId));
|
||||
EXPECT_TRUE(policy_engine_->CanDecrypt(kKeyId));
|
||||
|
||||
EXPECT_EQ(NO_ERROR, policy_engine_->Query(&query_info));
|
||||
EXPECT_EQ(QUERY_VALUE_STREAMING, query_info[QUERY_KEY_LICENSE_TYPE]);
|
||||
@@ -1562,7 +1650,7 @@ TEST_F(PolicyEngineQueryTest, QuerySuccess_LicenseDuration0) {
|
||||
policy_engine_->OnTimerEvent();
|
||||
}
|
||||
|
||||
EXPECT_FALSE(policy_engine_->CanDecrypt(kKeyId));
|
||||
EXPECT_TRUE(policy_engine_->CanDecrypt(kKeyId));
|
||||
|
||||
CdmQueryMap query_info;
|
||||
EXPECT_EQ(NO_ERROR, policy_engine_->Query(&query_info));
|
||||
|
||||
Reference in New Issue
Block a user