Update tests for ICarDisplayProxy - getIGBPObject test will be skipped if a target device does not support HIDL. - showWindow and hideWindow tests are modified to remove their dependency on previous tests. Bug: 391505530 Test: atest VtsHalCarDisplayTargetTest Change-Id: I0a294c2a23d1943f1b00de4aa3fd2c18f5b34ac9
diff --git a/automotive/display/aidl/vts/functional/VtsHalCarDisplayTargetTest.cpp b/automotive/display/aidl/vts/functional/VtsHalCarDisplayTargetTest.cpp index b3e4b5b..454d962 100644 --- a/automotive/display/aidl/vts/functional/VtsHalCarDisplayTargetTest.cpp +++ b/automotive/display/aidl/vts/functional/VtsHalCarDisplayTargetTest.cpp
@@ -27,6 +27,7 @@ #include <android/binder_process.h> #include <android/binder_status.h> #include <bufferqueueconverter/BufferQueueConverter.h> +#include <hidl/ServiceManagement.h> namespace { @@ -84,6 +85,11 @@ TEST_P(CarDisplayAidlTest, getIGBPObject) { LOG(INFO) << "Test getHGraphicBufferProducer method"; + if (!android::hardware::isHidlSupported()) { + // This test assumes that HIDL is supported on the target device. + GTEST_SKIP() << "Assumption failed; HIDL is not supported."; + } + for (const auto& id : mDisplayIds) { // Get a display info. DisplayDesc desc; @@ -112,6 +118,10 @@ TEST_P(CarDisplayAidlTest, showWindow) { LOG(INFO) << "Test showWindow method"; for (const auto& id : mDisplayIds) { + // Get a Surface object to register a target device. + aidl::android::view::Surface shimSurface; + ASSERT_TRUE(mDisplayProxy->getSurface(id, &shimSurface).isOk()); + ASSERT_TRUE(mDisplayProxy->showWindow(id).isOk()); } } @@ -120,6 +130,10 @@ LOG(INFO) << "Test hideWindow method"; for (const auto& id : mDisplayIds) { + // Get a Surface object to register a target device. + aidl::android::view::Surface shimSurface; + ASSERT_TRUE(mDisplayProxy->getSurface(id, &shimSurface).isOk()); + ASSERT_TRUE(mDisplayProxy->hideWindow(id).isOk()); } }