Sync fake clock for nonce tests

Because the fake clock is getting out of sync with the real clock
for the nonce flood tests, add a call to TestSleep::SyncFakeClock()
in Clock::GetCurrentTime() to force a sync.

Merged from http://go/wvgerrit/133223

Test: duration_use_case_test and nonce flood tests on bonito
Bug: 198329759
Change-Id: Idfd92c6cc57750a52477189461220c682b302082
This commit is contained in:
Vicky Min
2021-09-01 22:46:52 +00:00
parent e083486fe4
commit 9278c909d3

View File

@@ -35,6 +35,7 @@ FakeClock* g_fake_clock = nullptr;
// On devices running a fake OEMCrypto, we can use a fake sleep and fake time.
int64_t Clock::GetCurrentTime() {
wvcdm::TestSleep::SyncFakeClock();
if (g_fake_clock == nullptr) g_fake_clock = new FakeClock();
return g_fake_clock->now() / 1000;
}