From 3ca173fa163dbb74b9318f824d45db8d0567e8e8 Mon Sep 17 00:00:00 2001 From: Vicky Min Date: Wed, 1 Sep 2021 22:13:10 +0000 Subject: [PATCH] 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/132883 Test: duration_use_case_test and nonce flood tests on bonito Bug: 198329759 Change-Id: I2d66032a88dd0996252f1c31aee250246e6868fe --- libwvdrmengine/cdm/util/test/test_clock.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libwvdrmengine/cdm/util/test/test_clock.cpp b/libwvdrmengine/cdm/util/test/test_clock.cpp index bd4736de..2fa48439 100644 --- a/libwvdrmengine/cdm/util/test/test_clock.cpp +++ b/libwvdrmengine/cdm/util/test/test_clock.cpp @@ -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; }