From 4a37b21a223c1fb60780a028918eee7defb34448 Mon Sep 17 00:00:00 2001 From: Fred Gylys-Colwell Date: Wed, 16 Dec 2015 17:26:26 -0800 Subject: [PATCH] Close session before terminate Merge from the widevine repo of http://go/wvgerrit/16362 A test class holds a default session that it expects to be able to close in the tear down. This was not true in the TimingTest because it calls OEMCrypto_Terminate which closes all open sessions. This CL closes the default session, and then reopens it again after OEMCrypto_Initialize. Change-Id: Ib4128ec3c0a33794c03aa934174cb6fff448483e --- libwvdrmengine/oemcrypto/test/oemcrypto_test.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libwvdrmengine/oemcrypto/test/oemcrypto_test.cpp b/libwvdrmengine/oemcrypto/test/oemcrypto_test.cpp index bcc9dcbe..04825967 100644 --- a/libwvdrmengine/oemcrypto/test/oemcrypto_test.cpp +++ b/libwvdrmengine/oemcrypto/test/oemcrypto_test.cpp @@ -5495,10 +5495,13 @@ TEST_F(UsageTableTest, TimingTest) { sleep(kLongSleep); // This is as close to reboot as we can simulate in code. + ASSERT_NO_FATAL_FAILURE(session_.close()); // Close sessions before terminate. OEMCrypto_Terminate(); sleep(kShortSleep); OEMCrypto_Initialize(); EnsureTestKeys(); + // Test teardown expects session_ to be open. + ASSERT_NO_FATAL_FAILURE(session_.open()); // After a reboot, we should be able to reload keys, and generate reports. sleep(kLongSleep);