Adjust nonce flood rate in mock oemcrypto
Merge from Widevine repo of http://go/wvgerrit/43721 This CL allows the tester to change the nonce flood rate from the default of 20. A tester would want this value to be larger to make tests run more quickly. Setting the rate to 1 makes every other nonce request a flood error. A tester wants to do this in order to verify cdm code responds to nonce flood correctly. Several failing oemcrypto tests have also been corrected. This CL changes test code only. bug: 73607610 test: unit tests Change-Id: I3f52ff7ea9bcc1db7bc0e010da0b64a12d3b4dd3
This commit is contained in:
@@ -1197,15 +1197,17 @@ void Session::VerifyPST(const Test_PST_Report& expected) {
|
||||
char* pst_ptr = reinterpret_cast<char *>(computed.pst());
|
||||
std::string computed_pst(pst_ptr, pst_ptr + computed.pst_length());
|
||||
ASSERT_EQ(expected.pst, computed_pst);
|
||||
EXPECT_NEAR(expected.seconds_since_license_received,
|
||||
time_t now = time(NULL);
|
||||
int64_t age = now - expected.time_created; // How old is this report.
|
||||
EXPECT_NEAR(expected.seconds_since_license_received + age,
|
||||
computed.seconds_since_license_received(),
|
||||
kTimeTolerance);
|
||||
// Decrypt times only valid on licenses that have been active.
|
||||
if (expected.status == kActive || expected.status == kInactiveUsed) {
|
||||
EXPECT_NEAR(expected.seconds_since_first_decrypt,
|
||||
EXPECT_NEAR(expected.seconds_since_first_decrypt + age,
|
||||
computed.seconds_since_first_decrypt(),
|
||||
kUsageTableTimeTolerance);
|
||||
EXPECT_NEAR(expected.seconds_since_last_decrypt,
|
||||
EXPECT_NEAR(expected.seconds_since_last_decrypt + age,
|
||||
computed.seconds_since_last_decrypt(),
|
||||
kUsageTableTimeTolerance);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user