Reboot test: Initialize fake clock

[ Merge of http://go/wvgerrit/143630 ]

When we run a test with the fake clock, the clock had been initialized
to the current time, or to 0. This causes a problem for reboot tests
because the clock might go backwards over the reboot. With this
change, we monitor the clock at the end of one reboot pass and
initialize the clock for the next pass based on the previous value.

Bug: 26163469
Test: GtsMediaTestCases on sunfish
Change-Id: Ibd0024f963634382af70553fced38da6e1d857d2
This commit is contained in:
Rahul Frias
2022-03-13 18:35:54 -07:00
parent 520368cea2
commit 6cda6717a9
5 changed files with 73 additions and 0 deletions

View File

@@ -36,6 +36,12 @@ class RebootTest : public WvCdmTestBaseWithEngine {
static int test_pass() { return default_config_.test_pass(); }
// Load a previously saved time. Returns 0 if the value does not exist or
// cannot be parsed.
int64_t LoadTime(const std::string& key);
// Save a time to persistent storage.
void SaveTime(const std::string& key, int64_t time);
protected:
void SetUp() override;
void TearDown() override;