diff --git a/tv/cec/1.0/vts/functional/VtsHalTvCecV1_0TargetTest.cpp b/tv/cec/1.0/vts/functional/VtsHalTvCecV1_0TargetTest.cpp index 167f4c4bc6..b6f4b833d6 100644 --- a/tv/cec/1.0/vts/functional/VtsHalTvCecV1_0TargetTest.cpp +++ b/tv/cec/1.0/vts/functional/VtsHalTvCecV1_0TargetTest.cpp @@ -27,9 +27,12 @@ using ::android::sp; using ::android::hardware::hidl_death_recipient; +using ::android::hardware::hidl_vec; using ::android::hardware::Return; using ::android::hardware::tv::cec::V1_0::CecLogicalAddress; using ::android::hardware::tv::cec::V1_0::CecMessage; +using ::android::hardware::tv::cec::V1_0::HdmiPortInfo; +using ::android::hardware::tv::cec::V1_0::HdmiPortType; using ::android::hardware::tv::cec::V1_0::IHdmiCec; using ::android::hardware::tv::cec::V1_0::OptionKey; using ::android::hardware::tv::cec::V1_0::Result; @@ -96,6 +99,23 @@ TEST_P(HdmiCecTest, VendorId) { EXPECT_NE(ret, INCORRECT_VENDOR_ID); } +TEST_P(HdmiCecTest, GetPortInfo) { + hidl_vec ports; + Return ret = + hdmiCec->getPortInfo([&ports](hidl_vec list) { ports = list; }); + EXPECT_TRUE(ret.isOk()); + bool cecSupportedOnDevice = false; + for (size_t i = 0; i < ports.size(); ++i) { + EXPECT_TRUE((ports[i].type == HdmiPortType::OUTPUT) || + (ports[i].type == HdmiPortType::INPUT)); + if (ports[i].portId == 0) { + ALOGW("%s: Port id should start from 1", __func__); + } + cecSupportedOnDevice = cecSupportedOnDevice | ports[i].cecSupported; + } + EXPECT_NE(cecSupportedOnDevice, false) << "At least one port should support CEC"; +} + TEST_P(HdmiCecTest, SetOption) { Return ret; ret = hdmiCec->setOption(OptionKey::WAKEUP, false);