From 8350badbb5861fc3f26d1ada6ba2b980d955e9d9 Mon Sep 17 00:00:00 2001 From: Rahul Frias Date: Sun, 13 Mar 2022 16:28:46 -0700 Subject: [PATCH] Separate invalid session test for ReuseUsageEntry [ Merge of http://go/wvgerrit/144729 ] Since OEMCrypto_ReuseUsageEntry() was introduced in v17, splitting the test case for an invalid session from the other usage entry methods since they were implemented in v15/16 as well. Bug: 216193739 Test: GtsMediaTestCases on a sunfish Change-Id: I7f4399c07a19227495a15807228b930066f6a794 --- libwvdrmengine/oemcrypto/test/oemcrypto_test.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libwvdrmengine/oemcrypto/test/oemcrypto_test.cpp b/libwvdrmengine/oemcrypto/test/oemcrypto_test.cpp index 96bef331..7ecd1712 100644 --- a/libwvdrmengine/oemcrypto/test/oemcrypto_test.cpp +++ b/libwvdrmengine/oemcrypto/test/oemcrypto_test.cpp @@ -10030,7 +10030,7 @@ TEST_P(OEMCryptoUsageTableTest, PSTLargeBuffer) { } // Verify that a usage entry with an invalid session cannot be used. -TEST_P(OEMCryptoUsageTableTest, UsageEntryWithInvalidSessionAPI17) { +TEST_P(OEMCryptoUsageTableTest, UsageEntryWithInvalidSession) { std::string pst("pst"); LicenseWithUsageEntry entry; entry.license_messages().set_pst(pst); @@ -10048,6 +10048,13 @@ TEST_P(OEMCryptoUsageTableTest, UsageEntryWithInvalidSessionAPI17) { entry.session().close(); ASSERT_EQ(OEMCrypto_ERROR_INVALID_SESSION, OEMCrypto_MoveEntry(entry.session().session_id(), 0)); +} + +// Verify that a usage entry with an invalid session cannot be used. +TEST_P(OEMCryptoUsageTableTest, ReuseUsageEntryWithInvalidSessionAPI17) { + std::string pst("pst"); + LicenseWithUsageEntry entry; + entry.license_messages().set_pst(pst); entry.session().open(); ASSERT_NO_FATAL_FAILURE(entry.session().CreateNewUsageEntry());