Source release 17.1.2
This commit is contained in:
@@ -223,9 +223,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_;
|
||||
@@ -405,6 +407,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();
|
||||
@@ -434,6 +437,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();
|
||||
}
|
||||
@@ -451,6 +455,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_
|
||||
@@ -629,6 +634,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
|
||||
@@ -673,6 +679,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();
|
||||
|
||||
Reference in New Issue
Block a user