Add more slack to timing tests

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

This CL adjusts the tolerance in tests that check the license_received
time.  This was periodically failing because a nonce flood might delay
the test by 1 second, which was being rounded up to 2.  The tolerance
is now 3.  The time is explicily used when it is available.  Some
extra logging is also added to the mock.

bug:31458046

Change-Id: I450880cb3cd8bd5ef66cba13b94dd963d2663d9a
This commit is contained in:
Fred Gylys-Colwell
2017-02-13 18:10:58 -08:00
parent eade07c7a9
commit 7112a5eec3
4 changed files with 15 additions and 6 deletions

View File

@@ -971,7 +971,8 @@ OEMCryptoResult SessionContext::SelectContentKey(const KeyId& key_id) {
const KeyControlBlock& control = current_content_key()->control();
if (control.duration() > 0) {
if (control.duration() < CurrentTimer()) {
LOGE("[SelectContentKey(): KEY_EXPIRED]");
LOGE("[SelectContentKey(): KEY_EXPIRED %d versus %d]",
control.duration(), CurrentTimer());
return OEMCrypto_ERROR_KEY_EXPIRED;
}
}