CEC: Add Static Info Tests in Standby -CEC version
Add tests to check that the device responds with CEC version when in
standby.
Bug: 172202220
Test: atest cectGiveCecVersionInStandby
Change-Id: I454b0f7a8dd7ebc216a162295ac6a0354005afcd
diff --git a/hostsidetests/hdmicec/src/android/hdmicec/cts/common/HdmiCecSystemInformationTest.java b/hostsidetests/hdmicec/src/android/hdmicec/cts/common/HdmiCecSystemInformationTest.java
index d0db224..15eca65 100644
--- a/hostsidetests/hdmicec/src/android/hdmicec/cts/common/HdmiCecSystemInformationTest.java
+++ b/hostsidetests/hdmicec/src/android/hdmicec/cts/common/HdmiCecSystemInformationTest.java
@@ -26,6 +26,7 @@
import android.hdmicec.cts.HdmiCecConstants;
import android.hdmicec.cts.LogicalAddress;
+import com.android.tradefed.device.ITestDevice;
import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
import org.junit.Rule;
@@ -171,4 +172,30 @@
CecOperand.REPORT_FEATURES);
assertThat(CecMessage.getParams(reportFeatures, 2)).isEqualTo(cecVersion);
}
+
+ /**
+ * Tests that the device sends a {@code <CEC Version>} in response to a {@code <Get CEC
+ * Version>} in standby
+ */
+ @Test
+ public void cectGiveCecVersionInStandby() throws Exception {
+ ITestDevice device = getDevice();
+ try {
+ sendDeviceToSleepAndValidate();
+ hdmiCecClient.sendCecMessage(hdmiCecClient.getSelfDevice(), CecOperand.GET_CEC_VERSION);
+ String message =
+ hdmiCecClient.checkExpectedOutputOrFeatureAbort(
+ hdmiCecClient.getSelfDevice(),
+ CecOperand.CEC_VERSION,
+ CecOperand.GET_CEC_VERSION,
+ HdmiCecConstants.ABORT_NOT_IN_CORRECT_MODE);
+ assertThat(CecMessage.getParams(message))
+ .isIn(
+ Arrays.asList(
+ HdmiCecConstants.CEC_VERSION_2_0,
+ HdmiCecConstants.CEC_VERSION_1_4));
+ } finally {
+ wakeUpDevice();
+ }
+ }
}