CEC: Add VTS test to send CEC messages

Test: atest VtsHalTvCecV1_0TargetTest
Bug: 172316717
Change-Id: I717aa4b29ba38e9bc8ed68f04c9ca07e87e9b577
This commit is contained in:
Shraddha Basantwani 2021-01-22 16:21:50 +05:30
parent 0ebb24b4b7
commit 24a9d29a4e

View file

@ -29,8 +29,10 @@ using ::android::sp;
using ::android::hardware::hidl_death_recipient;
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::Result;
using ::android::hardware::tv::cec::V1_0::SendMessageResult;
#define CEC_VERSION 0x05
#define INCORRECT_VENDOR_ID 0x00
@ -73,6 +75,16 @@ TEST_P(HdmiCecTest, ClearAddLogicalAddress) {
EXPECT_EQ(ret, Result::SUCCESS);
}
TEST_P(HdmiCecTest, SendMessage) {
CecMessage message;
message.initiator = CecLogicalAddress::PLAYBACK_1;
message.destination = CecLogicalAddress::BROADCAST;
message.body.resize(1);
message.body[0] = 131;
SendMessageResult ret = hdmiCec->sendMessage(message);
EXPECT_EQ(ret, SendMessageResult::SUCCESS);
}
TEST_P(HdmiCecTest, CecVersion) {
Return<int32_t> ret = hdmiCec->getCecVersion();
EXPECT_GE(ret, CEC_VERSION);