Annotated Cts Tests with CDD Sections 7.9.2/7.1.4.2/7.1.4.1

Resolved Merge conflict for aosp/oreo-mr1-cts-dev

Cherry Pick commit baee08fa5f.
Changed Android.mk for tests/vr/Android.mk

7.1.4.1/C-5-1: Method checks to see if aep(android extension pack)
is supported for OpenGl ES 3.2

7.1.4.2/C-2-1: Method checks if feature flags are reported correctly

Added compatibility device util(local static libs) to Android.mk

Tests: none

Bug : 76418588

Change-Id: I26efb765cc76f12621cc1a533b0a6d70ffc426dd
Merged-In: I26efb765cc76f12621cc1a533b0a6d70ffc426dd
(cherry picked from commit b3d04068d43e9f898c65fd6440a9827e5f037d36)
diff --git a/tests/tests/graphics/src/android/graphics/cts/VulkanFeaturesTest.java b/tests/tests/graphics/src/android/graphics/cts/VulkanFeaturesTest.java
index e012d0e..31f83bf 100644
--- a/tests/tests/graphics/src/android/graphics/cts/VulkanFeaturesTest.java
+++ b/tests/tests/graphics/src/android/graphics/cts/VulkanFeaturesTest.java
@@ -36,6 +36,7 @@
 import org.junit.runner.RunWith;
 
 import java.io.UnsupportedEncodingException;
+import com.android.compatibility.common.util.CddTest;
 
 /**
  * Test that the Vulkan loader is present, supports the required extensions, and that system
@@ -89,7 +90,7 @@
 
         mVulkanDevices = getVulkanDevices();
     }
-
+    @CddTest(requirement="7.1.4.2/C-1-1,C-2-1")
     @Test
     public void testVulkanHardwareFeatures() throws JSONException {
         if (DEBUG) {
@@ -176,6 +177,7 @@
         }
     }
 
+    @CddTest(requirement="7.9.2/C-1-5")
     @Test
     public void testVulkanVersionForVrHighPerformance() {
         if (!mPm.hasSystemFeature(PackageManager.FEATURE_VR_MODE_HIGH_PERFORMANCE))
diff --git a/tests/tests/opengl/Android.mk b/tests/tests/opengl/Android.mk
index d623932..9338d81 100644
--- a/tests/tests/opengl/Android.mk
+++ b/tests/tests/opengl/Android.mk
@@ -29,7 +29,7 @@
 
 LOCAL_JNI_SHARED_LIBRARIES := libopengltest_jni
 
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner legacy-android-test
+LOCAL_STATIC_JAVA_LIBRARIES := compatibility-device-util ctstestrunner legacy-android-test
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
diff --git a/tests/tests/opengl/src/android/opengl/cts/OpenGlEsVersionTest.java b/tests/tests/opengl/src/android/opengl/cts/OpenGlEsVersionTest.java
index 4225de0..67415d70 100644
--- a/tests/tests/opengl/src/android/opengl/cts/OpenGlEsVersionTest.java
+++ b/tests/tests/opengl/src/android/opengl/cts/OpenGlEsVersionTest.java
@@ -31,6 +31,8 @@
 import android.support.test.runner.AndroidJUnit4;
 import android.util.Log;
 
+import com.android.compatibility.common.util.CddTest;
+
 import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
@@ -73,6 +75,7 @@
         mActivity = mActivityRule.getActivity();
     }
 
+    @CddTest(requirement="7.1.4.1/C-0-1")
     @Test
     public void testOpenGlEsVersion() throws InterruptedException {
         int detectedMajorVersion = getDetectedMajorVersion();
@@ -91,6 +94,7 @@
         }
     }
 
+    @CddTest(requirement="7.1.4.1/C-2-2")
     @Test
     public void testRequiredExtensions() throws InterruptedException {
         int reportedVersion = getVersionFromActivityManager(mActivity);
@@ -116,6 +120,7 @@
         }
     }
 
+    @CddTest(requirement="7.1.4.1/C-2-1,C-5-1,C-4-1")
     @Test
     public void testExtensionPack() throws InterruptedException {
         // Requirements:
@@ -144,7 +149,7 @@
             + (hasAepExtension ? "" : "not ") + "in the OpenGL ES extension list.",
             hasAepFeature, hasAepExtension);
     }
-
+    @CddTest(requirement="7.9.2/C-1-4")
     @Test
     public void testOpenGlEsVersionForVrHighPerformance() throws InterruptedException {
         if (!supportsVrHighPerformance())
@@ -160,6 +165,7 @@
             (major == 3 && minor >= 2) || major > 3);
     }
 
+    @CddTest(requirement="7.9.2/C-1-6,C-1-8")
     @Test
     public void testRequiredExtensionsForVrHighPerformance() throws InterruptedException {
         if (!supportsVrHighPerformance())
@@ -196,7 +202,7 @@
                 requiredEglList[i], hasExtension(extensions, requiredEglList[i]));
         }
     }
-
+    @CddTest(requirement="7.1.4.1/C-6-1")
     @Test
     public void testRequiredEglExtensions() {
         // See CDD section 7.1.4
@@ -340,6 +346,7 @@
      * Check that the version string has the form "OpenGL ES(-CM)? (\d+)\.(\d+)", where the two
      * numbers match the major and minor parameters.
      */
+    @CddTest(requirement="7.1.4.1/C-0-1")
     private void verifyGlVersionString(int major, int minor) throws InterruptedException {
         Matcher matcher = Pattern.compile("OpenGL ES(?:-CM)? (\\d+)\\.(\\d+).*")
                                  .matcher(mActivity.getVersionString());
diff --git a/tests/vr/Android.mk b/tests/vr/Android.mk
index 74aebf1..ea47d2b 100644
--- a/tests/vr/Android.mk
+++ b/tests/vr/Android.mk
@@ -27,7 +27,7 @@
 # When built, explicitly put it in the data partition.
 LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
 
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner legacy-android-test
+LOCAL_STATIC_JAVA_LIBRARIES := compatibility-device-util ctstestrunner legacy-android-test
 
 LOCAL_JNI_SHARED_LIBRARIES := libctsvrextensions_jni libnativehelper_compat_libc++
 
diff --git a/tests/vr/src/android/vr/cts/VrCpuTest.java b/tests/vr/src/android/vr/cts/VrCpuTest.java
index 8bc1aec..c6a094e 100644
--- a/tests/vr/src/android/vr/cts/VrCpuTest.java
+++ b/tests/vr/src/android/vr/cts/VrCpuTest.java
@@ -18,6 +18,7 @@
 import android.content.pm.PackageManager;
 import android.os.Process;
 import android.test.ActivityInstrumentationTestCase2;
+import com.android.compatibility.common.util.CddTest;
 
 public class VrCpuTest extends ActivityInstrumentationTestCase2<CtsActivity> {
     private CtsActivity mActivity;
@@ -25,7 +26,7 @@
     public VrCpuTest() {
         super(CtsActivity.class);
     }
-
+    @CddTest(requirement="7.9.2/C-1-1")
     public void testHasAtLeastTwoCores() {
         mActivity = getActivity();
         if (mActivity.getPackageManager().hasSystemFeature(
diff --git a/tests/vr/src/android/vr/cts/VrDisplayTest.java b/tests/vr/src/android/vr/cts/VrDisplayTest.java
index 0e91b4b..16de706 100644
--- a/tests/vr/src/android/vr/cts/VrDisplayTest.java
+++ b/tests/vr/src/android/vr/cts/VrDisplayTest.java
@@ -24,6 +24,7 @@
 import android.view.WindowManager;
 
 import java.nio.IntBuffer;
+import com.android.compatibility.common.util.CddTest;
 
 public class VrDisplayTest extends ActivityInstrumentationTestCase2<OpenGLESActivity> {
 
@@ -50,6 +51,7 @@
     /**
      * Tests that the refresh rate is at least 60Hz.
      */
+     @CddTest(requirement="7.9.2/C-1-15")
     public void testRefreshRateIsAtLeast60Hz() throws Throwable {
         final int NUM_FRAMES = 200;
         // Add an extra frame to allow the activity to start up.
@@ -74,6 +76,7 @@
     /**
      * Tests that the display resolution is at least 1080p.
      */
+    @CddTest(requirement="7.9.2/C-1-14")
     public void testDisplayResolution() {
         mActivity = getGlEsActivity(1, OpenGLESActivity.RENDERER_BASIC);
         if (!mActivity.supportsVrHighPerformance())