diff options
| author | Robert Shih <robertshih@google.com> | 2019-03-08 15:06:40 -0800 |
|---|---|---|
| committer | Robert Shih <robertshih@google.com> | 2019-03-11 18:07:33 -0700 |
| commit | 90af5f189891076b5224f14060f4e61c36eae723 (patch) | |
| tree | c379a65f69cbae76f1f2ab9b2a66b938b03ab5f3 /drm | |
| parent | b45f700b340ce149841d64f9fa53d910d6b9a75c (diff) | |
| download | android_hardware_interfaces-90af5f189891076b5224f14060f4e61c36eae723.tar.gz android_hardware_interfaces-90af5f189891076b5224f14060f4e61c36eae723.tar.bz2 android_hardware_interfaces-90af5f189891076b5224f14060f4e61c36eae723.zip | |
DrmHalTest.OfflineLicenseStateTest: search keySetId
Search for key set id instead of simply checking the number of total
offline licenses.
Fix LOG_TAG & remove clearkey specific comments from generic plugin
tests.
Bug: 118402843
Test: VtsHalDrmV1_2TargetTest
Change-Id: I245007317c813d5a8585d0a4ee29816b8f51ad3c
Diffstat (limited to 'drm')
| -rw-r--r-- | drm/1.2/vts/functional/drm_hal_test.cpp | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/drm/1.2/vts/functional/drm_hal_test.cpp b/drm/1.2/vts/functional/drm_hal_test.cpp index 067b5e474..6043391dd 100644 --- a/drm/1.2/vts/functional/drm_hal_test.cpp +++ b/drm/1.2/vts/functional/drm_hal_test.cpp @@ -14,7 +14,7 @@ * limitations under the License. */ -#define LOG_TAG "drm_hal_clearkey_test@1.2" +#define LOG_TAG "drm_hal_test@1.2" #include <gtest/gtest.h> #include <hidl/HidlSupport.h> @@ -180,19 +180,36 @@ void checkKeySetIdState(Status status, OfflineLicenseState state) { } /** - * Test clearkey plugin offline key support + * Test drm plugin offline key support */ TEST_P(DrmHalTest, OfflineLicenseTest) { auto sessionId = openSession(); hidl_vec<uint8_t> keySetId = loadKeys(sessionId, KeyType::OFFLINE); - auto res = drmPlugin->getOfflineLicenseKeySetIds(checkKeySetIds<Status::OK, 1u>); + auto res = drmPlugin->getOfflineLicenseKeySetIds( + [&](Status status, const hidl_vec<KeySetId>& keySetIds) { + bool found = false; + EXPECT_EQ(Status::OK, status); + for (KeySetId keySetId2: keySetIds) { + if (keySetId == keySetId2) { + found = true; + break; + } + } + EXPECT_TRUE(found) << "keySetId not found"; + }); EXPECT_OK(res); Status err = drmPlugin->removeOfflineLicense(keySetId); EXPECT_EQ(Status::OK, err); - res = drmPlugin->getOfflineLicenseKeySetIds(checkKeySetIds<Status::OK, 0u>); + res = drmPlugin->getOfflineLicenseKeySetIds( + [&](Status status, const hidl_vec<KeySetId>& keySetIds) { + EXPECT_EQ(Status::OK, status); + for (KeySetId keySetId2: keySetIds) { + EXPECT_NE(keySetId, keySetId2); + } + }); EXPECT_OK(res); err = drmPlugin->removeOfflineLicense(keySetId); @@ -202,7 +219,7 @@ TEST_P(DrmHalTest, OfflineLicenseTest) { } /** - * Test clearkey plugin offline key state + * Test drm plugin offline key state */ TEST_P(DrmHalTest, OfflineLicenseStateTest) { auto sessionId = openSession(); |
