From 9278c909d3714165b233f77f9d225a1a0e03bf22 Mon Sep 17 00:00:00 2001 From: Vicky Min Date: Wed, 1 Sep 2021 22:46:52 +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/133223 Test: duration_use_case_test and nonce flood tests on bonito Bug: 198329759 Change-Id: Idfd92c6cc57750a52477189461220c682b302082 --- 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; }