summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2020-03-05 03:07:11 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2020-03-05 03:07:11 +0000
commit16b3d9d089f81654f2a1a547e33753c8079d6621 (patch)
treeb323dc5ca1477e0882e944ed13a09b64f6e4f54e
parent7af7d77e720a72a84b9a22181a0e377eab8b537e (diff)
parentbabbce961213bc639c9259068a94d867c3bb657c (diff)
downloadcts-16b3d9d089f81654f2a1a547e33753c8079d6621.tar.gz
Merge changes Ic0e244ee,I5c84d0d0
* changes: Add Hdmi Cec Request To Intiate ARC Test Add Hdmi Cec Intiate ARC Test
-rw-r--r--hostsidetests/hdmicec/src/android/hdmicec/cts/CecMessage.java2
-rw-r--r--hostsidetests/hdmicec/src/android/hdmicec/cts/audio/HdmiCecAudioReturnChannelControlTest.java70
2 files changed, 72 insertions, 0 deletions
diff --git a/hostsidetests/hdmicec/src/android/hdmicec/cts/CecMessage.java b/hostsidetests/hdmicec/src/android/hdmicec/cts/CecMessage.java
index e9c8c7f77d6..dd3448107c2 100644
--- a/hostsidetests/hdmicec/src/android/hdmicec/cts/CecMessage.java
+++ b/hostsidetests/hdmicec/src/android/hdmicec/cts/CecMessage.java
@@ -47,6 +47,8 @@ public enum CecMessage {
INACTIVE_SOURCE(0x9d),
CEC_VERSION(0x9e),
GET_CEC_VERSION(0x9f),
+ INITIATE_ARC(0xc0),
+ REQUEST_ARC_INITIATION(0xc3),
ABORT(0xff);
private final int messageId;
diff --git a/hostsidetests/hdmicec/src/android/hdmicec/cts/audio/HdmiCecAudioReturnChannelControlTest.java b/hostsidetests/hdmicec/src/android/hdmicec/cts/audio/HdmiCecAudioReturnChannelControlTest.java
new file mode 100644
index 00000000000..f9665267544
--- /dev/null
+++ b/hostsidetests/hdmicec/src/android/hdmicec/cts/audio/HdmiCecAudioReturnChannelControlTest.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hdmicec.cts.audio;
+
+import android.hdmicec.cts.CecDevice;
+import android.hdmicec.cts.CecMessage;
+import android.hdmicec.cts.HdmiCecClientWrapper;
+import android.hdmicec.cts.HdmiCecConstants;
+
+import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
+import com.android.tradefed.testtype.junit4.BaseHostJUnit4Test;
+
+import org.junit.Rule;
+import org.junit.runner.RunWith;
+import org.junit.Test;
+
+/** HDMI CEC test to test audio return channel control (Section 11.2.17) */
+@RunWith(DeviceJUnit4ClassRunner.class)
+public final class HdmiCecAudioReturnChannelControlTest extends BaseHostJUnit4Test {
+ private static final CecDevice AUDIO_DEVICE = CecDevice.AUDIO_SYSTEM;
+
+ @Rule
+ public HdmiCecClientWrapper hdmiCecClient = new HdmiCecClientWrapper(AUDIO_DEVICE, this);
+
+ /**
+ * Test 11.2.17-1
+ * Tests that the device sends a directly addressed <Initiate ARC> message
+ * when it wants to initiate ARC.
+ */
+ @Test
+ public void cect_11_2_17_1_InitiateArc() throws Exception {
+ hdmiCecClient.sendCecMessage(CecDevice.TV, CecDevice.BROADCAST,
+ CecMessage.REPORT_PHYSICAL_ADDRESS,
+ hdmiCecClient.formatParams(HdmiCecConstants.TV_PHYSICAL_ADDRESS,
+ HdmiCecConstants.PHYSICAL_ADDRESS_LENGTH));
+ getDevice().executeShellCommand("reboot");
+ getDevice().waitForBootComplete(HdmiCecConstants.REBOOT_TIMEOUT);
+ hdmiCecClient.checkExpectedOutput(CecDevice.TV, CecMessage.INITIATE_ARC);
+ }
+
+ /**
+ * Test 11.2.17-3
+ * Tests that the device sends a directly addressed <Initiate ARC>
+ * message when it is requested to initiate ARC.
+ */
+ @Test
+ public void cect_11_2_17_3_RequestToInitiateArc() throws Exception {
+ hdmiCecClient.sendCecMessage(CecDevice.TV, CecDevice.BROADCAST,
+ CecMessage.REPORT_PHYSICAL_ADDRESS,
+ hdmiCecClient.formatParams(HdmiCecConstants.TV_PHYSICAL_ADDRESS,
+ HdmiCecConstants.PHYSICAL_ADDRESS_LENGTH));
+ hdmiCecClient.sendCecMessage(CecDevice.TV, AUDIO_DEVICE,
+ CecMessage.REQUEST_ARC_INITIATION);
+ hdmiCecClient.checkExpectedOutput(CecDevice.TV, CecMessage.INITIATE_ARC);
+ }
+}