Add fudge to duration tests am: 20833734e1 am: fd451af75b

Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/14664668

Change-Id: I8966f72720a092701e0e15aeb19a75d7fcd82b68
This commit is contained in:
Fred Gylys-Colwell
2021-05-25 22:38:14 +00:00
committed by Automerger Merge Worker

View File

@@ -358,8 +358,10 @@ class CdmDurationTest : public WvCdmTestBaseWithEngine,
// this tests a cyan bar with a black X. This assumes that |cutoff| is before // this tests a cyan bar with a black X. This assumes that |cutoff| is before
// |stop|. Both |start| and |cutoff| are system times. // |stop|. Both |start| and |cutoff| are system times.
void TerminatePlayback(uint64_t start, uint64_t cutoff) { void TerminatePlayback(uint64_t start, uint64_t cutoff) {
ASSERT_LT(start, cutoff); // We subtract some fudge from the cutoff to account for possible round off
AllowPlayback(start, cutoff); // error when computing the playback window.
ASSERT_LT(start, cutoff - kFudge);
AllowPlayback(start, cutoff - kFudge);
SleepUntil(cutoff + kFudge); SleepUntil(cutoff + kFudge);
FailDecrypt(); FailDecrypt();
} }