[RESTRICT AUTOMERGE] Sync OEMCrypto, ODK files and unit tests

run android/copy_files from cdm repo to sync files in Android
tm-widevine-release.

Changes include:
1. Update ODK to 17.1
2. update in license_protocol.proto
3. updates in oemcrypto unit tests
4. A few cdm and util test updates
5. Prov4 unit test fixes

Originating CLs:
https://widevine-internal-review.googlesource.com/c/cdm/+/155289/
https://widevine-internal-review.googlesource.com/c/cdm/+/155429/
https://widevine-internal-review.googlesource.com/c/cdm/+/155430/
https://widevine-internal-review.googlesource.com/c/cdm/+/154415/
https://widevine-internal-review.googlesource.com/c/cdm/+/156457/
https://widevine-internal-review.googlesource.com/c/cdm/+/156878/
https://widevine-internal-review.googlesource.com/c/cdm/+/156879/
https://widevine-internal-review.googlesource.com/c/cdm/+/156425/
https://widevine-internal-review.googlesource.com/c/cdm/+/156486/
https://widevine-internal-review.googlesource.com/c/cdm/+/156539/
https://widevine-internal-review.googlesource.com/c/cdm/+/156542/

Test: ran oemcrypto unit tests and ODK tests
Test: ran gts media test cases
Bug: 239201888

Change-Id: Iad9aff72aec5ba42296582837f34dd704bc11810
This commit is contained in:
Cong Lin
2022-09-22 13:39:14 -07:00
parent fa8c0a9a62
commit 0f32f41bd1
38 changed files with 770 additions and 413 deletions

View File

@@ -222,9 +222,11 @@ void RebootTest::SetUp() {
EXPECT_EQ(read, file_size) << "Error reading persistent data file.";
EXPECT_TRUE(ParseDump(dump, &persistent_data_));
}
TestSleep::SyncFakeClock();
}
void RebootTest::TearDown() {
TestSleep::SyncFakeClock();
auto file = file_system_->Open(persistent_data_filename_,
FileSystem::kCreate | FileSystem::kTruncate);
ASSERT_TRUE(file) << "Failed to open file: " << persistent_data_filename_;
@@ -404,6 +406,7 @@ class OfflineLicense {
// Fetch and load the license. The session is left open.
void LoadLicense() {
license_holder_.OpenSession();
TestSleep::SyncFakeClock();
start_of_rental_clock_ = wvutil::Clock().GetCurrentTime();
license_holder_.FetchLicense();
license_holder_.LoadLicense();
@@ -433,6 +436,7 @@ class OfflineLicense {
// Verify that the license may be used to decrypt content.
void Decrypt() {
TestSleep::SyncFakeClock();
if (start_of_playback_ == 0) {
start_of_playback_ = wvutil::Clock().GetCurrentTime();
}
@@ -450,6 +454,7 @@ class OfflineLicense {
// Verify that the license has expired, and may not be used to decrypt
// content.
void FailDecrypt() {
TestSleep::SyncFakeClock();
const KeyId key_id = "0000000000000000";
EXPECT_EQ(NEED_KEY, license_holder_.Decrypt(key_id))
<< "Decrypt should have failed for " << content_id_
@@ -628,6 +633,7 @@ class OfflineLicenseTest : public RebootTest {
int decrypt_count = 0;
int fail_count = 0;
for (auto time : interesting_times_) {
TestSleep::SyncFakeClock();
int64_t now = wvutil::Clock().GetCurrentTime();
int64_t delta = (time - now);
// It is not necessarily an error for the delta to be negative. But it is
@@ -672,6 +678,7 @@ class OfflineLicenseTest : public RebootTest {
for (size_t i = first_valid_[n] + 1; i < test_case_[n].size(); i++) {
OfflineLicense* license = test_case_[n][i].get();
ASSERT_NO_FATAL_FAILURE(license->ReloadLicense());
TestSleep::SyncFakeClock();
int64_t now = wvutil::Clock().GetCurrentTime();
if (now <= license->cutoff() - kFudge) {
license->Decrypt();