Source release 15.1.0

This commit is contained in:
John W. Bruce
2019-03-29 18:16:05 -07:00
parent 66628486b5
commit 2b26dee09c
44 changed files with 1371 additions and 356 deletions

View File

@@ -405,10 +405,10 @@ TEST_F(WvCdmEngineTest, ParseDecryptHashStringTest) {
const std::string test_frame_number_string =
std::to_string(test_frame_number);
const std::string test_invalid_hash = "an invalid hash";
std::vector<uint8_t> binary_hash{ 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38 };
std::vector<uint8_t> binary_hash{ 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0xFF };
const std::string test_valid_decoded_hash(binary_hash.begin(),
binary_hash.end());
const std::string test_valid_hash = Base64Encode(binary_hash);
const std::string test_valid_hash = b2a_hex(binary_hash);
const std::string test_invalid_hash_string = "sample hash string";
const std::string test_valid_hash_string = test_session_id + kComma +
test_frame_number_string + kComma + test_valid_hash;

View File

@@ -361,7 +361,7 @@ TEST_F(CdmSessionTest, UpdateUsageEntry) {
std::string serialized_metrics;
ASSERT_TRUE(metrics.SerializeToString(&serialized_metrics));
EXPECT_GT(metrics.crypto_metrics()
.crypto_session_update_usage_entry_time_us().size(), 0)
.usage_table_header_update_entry_time_us().size(), 0)
<< "Missing update usage entry metric. Metrics: "
<< wvcdm::b2a_hex(serialized_metrics);
}

View File

@@ -819,6 +819,40 @@ TEST_F(PolicyEngineTest, PlaybackOk_RentalAndLicense0_WithPlayback) {
EXPECT_FALSE(policy_engine_->CanDecryptContent(kSomeRandomKeyId));
}
TEST_F(PolicyEngineTest,
PlaybackOk_RentalAndLicense0_WithPlaybackBeforeLicense) {
License_Policy* policy = license_.mutable_policy();
policy->clear_license_duration_seconds();
policy->clear_rental_duration_seconds();
// Only |playback_duration_seconds| set.
policy_engine_->BeginDecryption();
EXPECT_CALL(*mock_clock_, GetCurrentTime())
.WillOnce(Return(kLicenseStartTime + 1))
.WillOnce(Return(kPlaybackStartTime))
.WillOnce(Return(kPlaybackStartTime + kPlaybackDuration - 10))
.WillOnce(Return(kPlaybackStartTime + kPlaybackDuration + 10));
ExpectSessionKeysChange(kKeyStatusExpired, false);
ExpectSessionKeysChange(kKeyStatusUsable, true);
EXPECT_CALL(mock_event_listener_, OnExpirationUpdate(_, 0));
EXPECT_CALL(mock_event_listener_,
OnExpirationUpdate(_, kPlaybackStartTime + kPlaybackDuration));
policy_engine_->SetLicense(license_);
policy_engine_->BeginDecryption();
policy_engine_->OnTimerEvent();
EXPECT_TRUE(policy_engine_->CanDecryptContent(kKeyId));
EXPECT_FALSE(policy_engine_->CanDecryptContent(kSomeRandomKeyId));
policy_engine_->OnTimerEvent();
EXPECT_FALSE(policy_engine_->CanDecryptContent(kKeyId));
EXPECT_FALSE(policy_engine_->CanDecryptContent(kSomeRandomKeyId));
}
TEST_F(PolicyEngineTest, PlaybackOk_Durations0) {
License_Policy* policy = license_.mutable_policy();
policy->set_rental_duration_seconds(kDurationUnlimited);