Add fudge to duration tests

Merge from Widevine repo of http://go/wvgerrit/125046

Add some extra fudge to the termination time. This assumes that flaky
tests were caused by roundoff error.

Bug: 175741647
Change-Id: I9bcc86f9b9540e5985df647dd1b5c5d439556e2b
This commit is contained in:
Fred Gylys-Colwell
2021-05-20 15:28:12 +00:00
parent eaa1e6d4a0
commit 20833734e1

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
// |stop|. Both |start| and |cutoff| are system times.
void TerminatePlayback(uint64_t start, uint64_t cutoff) {
ASSERT_LT(start, cutoff);
AllowPlayback(start, cutoff);
// We subtract some fudge from the cutoff to account for possible round off
// error when computing the playback window.
ASSERT_LT(start, cutoff - kFudge);
AllowPlayback(start, cutoff - kFudge);
SleepUntil(cutoff + kFudge);
FailDecrypt();
}