CEC: Add VTS test to get port info am: 0098a8d3d5
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1579866 Change-Id: I0ee48e76b5741a2b7770571f3950ee3fd30e971e
This commit is contained in:
commit
5437ca198c
1 changed files with 20 additions and 0 deletions
|
@ -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<HdmiPortInfo> ports;
|
||||
Return<void> ret =
|
||||
hdmiCec->getPortInfo([&ports](hidl_vec<HdmiPortInfo> 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<void> ret;
|
||||
ret = hdmiCec->setOption(OptionKey::WAKEUP, false);
|
||||
|
|
Loading…
Reference in a new issue