CEC: Add VTS test to set option am: 57af1d4b9a am: c2e83b76b8 am: 7dbed4a1ab

Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1577104

Change-Id: I63afe27dd4ad7d493e7d2e0be78f1f3779c7d653
This commit is contained in:
Shraddha Basantwani 2021-03-30 12:43:16 +00:00 committed by Automerger Merge Worker
commit 3550814954

View file

@ -31,6 +31,7 @@ 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::IHdmiCec;
using ::android::hardware::tv::cec::V1_0::OptionKey;
using ::android::hardware::tv::cec::V1_0::Result;
using ::android::hardware::tv::cec::V1_0::SendMessageResult;
@ -94,3 +95,20 @@ TEST_P(HdmiCecTest, VendorId) {
Return<uint32_t> ret = hdmiCec->getVendorId();
EXPECT_NE(ret, INCORRECT_VENDOR_ID);
}
TEST_P(HdmiCecTest, SetOption) {
Return<void> ret;
ret = hdmiCec->setOption(OptionKey::WAKEUP, false);
EXPECT_TRUE(ret.isOk());
ret = hdmiCec->setOption(OptionKey::ENABLE_CEC, false);
EXPECT_TRUE(ret.isOk());
ret = hdmiCec->setOption(OptionKey::SYSTEM_CEC_CONTROL, true);
EXPECT_TRUE(ret.isOk());
// Restore option keys to their default values
ret = hdmiCec->setOption(OptionKey::WAKEUP, true);
EXPECT_TRUE(ret.isOk());
ret = hdmiCec->setOption(OptionKey::ENABLE_CEC, true);
EXPECT_TRUE(ret.isOk());
ret = hdmiCec->setOption(OptionKey::SYSTEM_CEC_CONTROL, false);
EXPECT_TRUE(ret.isOk());
}