remove obsolete GL jank test

Bug: 27600015
Change-Id: Ie819c532b49eeb1447509e247d46974bbfbf426a
diff --git a/OldCtsTestCaseList.mk b/OldCtsTestCaseList.mk
index d2eb85b..5863360 100644
--- a/OldCtsTestCaseList.mk
+++ b/OldCtsTestCaseList.mk
@@ -259,7 +259,6 @@
     CtsCppToolsTestCases \
     CtsDevicePolicyManagerTestCases \
     CtsDumpsysHostTestCases \
-    CtsJankHostTestCases \
     CtsHostsideNetworkTests \
     CtsJdwpSecurityHostTestCases \
     CtsMonkeyTestCases \
@@ -288,7 +287,6 @@
     CtsUiAutomatorTestCases
 
 cts_device_jars := \
-    CtsJankTestJar \
     CtsJdwpApp
 
 cts_target_junit_tests := \
diff --git a/hostsidetests/jank/Android.mk b/hostsidetests/jank/Android.mk
deleted file mode 100644
index 5e78831..0000000
--- a/hostsidetests/jank/Android.mk
+++ /dev/null
@@ -1,50 +0,0 @@
-# Copyright (C) 2013 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.
-
-LOCAL_PATH:= $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_MODULE := CtsJankHostTestCases
-
-LOCAL_JAVA_LIBRARIES := cts-tradefed tradefed-prebuilt compatibility-host-util
-
-LOCAL_STATIC_JAVA_LIBRARIES := cts-migration-lib
-
-LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
-
-LOCAL_CTS_TEST_PACKAGE := android.jank.cts
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts
-
-LOCAL_DEVICE_JAR_ := CtsJankTestJar
-cts_library_jar_ := $(CTS_TESTCASES_OUT)/$(LOCAL_DEVICE_JAR_).jar
-
-$(cts_library_jar_): $(call intermediates-dir-for,JAVA_LIBRARIES,$(LOCAL_DEVICE_JAR_))/javalib.jar | $(ACP)
-	$(hide) mkdir -p $(CTS_TESTCASES_OUT)
-	$(hide) $(ACP) -fp $< $@
-
-$(CTS_TESTCASES_OUT)/CtsJankHostTestCases.xml: $(cts_library_jar_)
-
-include $(BUILD_CTS_HOST_JAVA_LIBRARY)
-
-$(COMPATIBILITY_TESTCASES_OUT_cts)/CtsJankHostTestCases.jar : $(COMPATIBILITY_TESTCASES_OUT_cts)/CtsOpenGlPerf2TestCases.apk
-
-# Build the library using its own makefile
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/hostsidetests/jank/AndroidTest.xml b/hostsidetests/jank/AndroidTest.xml
deleted file mode 100644
index a938678..0000000
--- a/hostsidetests/jank/AndroidTest.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2015 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.
--->
-<configuration description="Config for CTS Jank host test cases">
-    <test class="com.android.compatibility.common.tradefed.testtype.JarHostTest" >
-        <option name="jar" value="CtsJankHostTestCases.jar" />
-        <option name="runtime-hint" value="4m41s" />
-    </test>
-</configuration>
diff --git a/hostsidetests/jank/app/Android.mk b/hostsidetests/jank/app/Android.mk
deleted file mode 100644
index a22c949..0000000
--- a/hostsidetests/jank/app/Android.mk
+++ /dev/null
@@ -1,31 +0,0 @@
-# Copyright (C) 2013 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.
-
-LOCAL_PATH:= $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_MODULE_TAGS := optional
-LOCAL_MODULE := CtsJankTestJar
-LOCAL_DEX_PREOPT := false
-
-# Tag this module as a cts test artifact
-LOCAL_COMPATIBILITY_SUITE := cts
-
-LOCAL_JAVA_LIBRARIES := uiautomator.core
-
-LOCAL_STATIC_JAVA_LIBRARIES := com.android.uiautomator.platform.common
-
-include $(BUILD_JAVA_LIBRARY)
\ No newline at end of file
diff --git a/hostsidetests/jank/app/src/android/jank/cts/CtsJankTestBase.java b/hostsidetests/jank/app/src/android/jank/cts/CtsJankTestBase.java
deleted file mode 100644
index 1eda12f..0000000
--- a/hostsidetests/jank/app/src/android/jank/cts/CtsJankTestBase.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright (C) 2013 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.jank.cts;
-
-import android.os.Bundle;
-import android.util.Log;
-
-import com.android.uiautomator.platform.JankTestBase;
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.util.Scanner;
-
-public class CtsJankTestBase extends JankTestBase {
-    private final static String TAG = CtsJankTestBase.class.getName();
-    protected final static String START_CMD = "am start -W -a android.intent.action.MAIN -n %s";
-    protected final static String STOP_CMD = "am force-stop %s";
-    protected final static String INTENT_STRING_EXTRA = " --es %s %s";
-    protected final static String INTENT_BOOLEAN_EXTRA = " --ez %s %b";
-    protected final static String INTENT_INTEGER_EXTRA = " --ei %s %d";
-    protected static long SLEEP_TIME = 2000; // 2 seconds
-    protected static int NUM_ITERATIONS = 5;
-    protected static int TRACE_TIME = 5;
-
-    @Override
-    protected String getPropertyString(Bundle params, String key)
-            throws FileNotFoundException, IOException {
-        if (key.equals("iteration")) {
-            return NUM_ITERATIONS + "";
-        }
-        if (key.equals("tracetime")) {
-            return TRACE_TIME + "";
-        }
-        return super.getPropertyString(params, key);
-    }
-
-    protected void runShellCommand(String command) throws Exception {
-        Process p = null;
-        Scanner out = null;
-        Scanner err = null;
-        try {
-            p = Runtime.getRuntime().exec(command);
-
-            StringBuilder outStr = new StringBuilder();
-            StringBuilder errStr = new StringBuilder();
-            out = new Scanner(p.getInputStream());
-            err = new Scanner(p.getErrorStream());
-            boolean read = true;
-            while (read) {
-                if (out.hasNextLine()) {
-                    outStr.append(out.nextLine());
-                    outStr.append("\n");
-                } else if (err.hasNextLine()) {
-                    errStr.append(err.nextLine());
-                    errStr.append("\n");
-                } else {
-                    read = false;
-                }
-            }
-            Log.i(TAG, command);
-            if (outStr.length() > 0) {
-                Log.i(TAG, outStr.toString());
-            }
-            if (errStr.length() > 0) {
-                Log.e(TAG, errStr.toString());
-            }
-        } finally {
-            if (p != null) {
-                int status = p.waitFor();
-                if (status != 0) {
-                    throw new RuntimeException(
-                            String.format("Run shell command: %s, status: %s", command, status));
-                }
-                p.destroy();
-                p = null;
-            }
-            if (out != null) {
-                out.close();
-            }
-            if (err != null) {
-                err.close();
-            }
-        }
-    }
-}
diff --git a/hostsidetests/jank/app/src/android/jank/cts/opengl/CtsDeviceJankOpenGl.java b/hostsidetests/jank/app/src/android/jank/cts/opengl/CtsDeviceJankOpenGl.java
deleted file mode 100755
index 46dc06c..0000000
--- a/hostsidetests/jank/app/src/android/jank/cts/opengl/CtsDeviceJankOpenGl.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright (C) 2013 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.jank.cts.opengl;
-
-import android.jank.cts.CtsJankTestBase;
-import android.util.Log;
-
-import com.android.uiautomator.platform.SurfaceFlingerHelper;
-
-public class CtsDeviceJankOpenGl extends CtsJankTestBase {
-    private final static String TAG = CtsDeviceJankOpenGl.class.getName();
-    private final static String PACKAGE = "android.opengl2.cts";
-    private final static String COMPONENT =
-            PACKAGE + "/" + PACKAGE + ".primitive.GLPrimitiveActivity";
-    private static String APP_WINDOW_NAME = "SurfaceView";
-
-    /**
-     * Runs the full OpenGL ES 2.0 pipeline test.
-     */
-    public void testFullPipeline() throws Exception {
-        runBenchmark("FullPipeline");
-    }
-
-    /**
-     * Runs the pixel output test.
-     */
-    public void testPixelOutput() throws Exception {
-        runBenchmark("PixelOutput");
-    }
-
-    /**
-     * Runs the shader performance test.
-     */
-    public void testShaderPerf() throws Exception {
-        runBenchmark("ShaderPerf");
-    }
-
-    /**
-     * Runs the context switch overhead test.
-     */
-    public void testContextSwitch() throws Exception {
-        runBenchmark("ContextSwitch");
-    }
-
-    /**
-     * Runs the benchhmark for jank test.
-     */
-    public void runBenchmark(String benchmark) throws Exception {
-        // Start activity command
-        final StringBuilder sb = new StringBuilder();
-        sb.append(String.format(START_CMD, COMPONENT));
-        sb.append(String.format(INTENT_STRING_EXTRA, "benchmark_name", benchmark));
-        sb.append(String.format(INTENT_BOOLEAN_EXTRA, "offscreen", false));
-        sb.append(String.format(INTENT_INTEGER_EXTRA, "num_frames", 1000));
-        sb.append(String.format(INTENT_INTEGER_EXTRA, "num_iterations", 1));
-        sb.append(String.format(INTENT_INTEGER_EXTRA, "timeout", 10000));
-        final String startCommand = sb.toString();
-        final String stopCommand = String.format(STOP_CMD, PACKAGE);
-
-        Log.i(TAG, "Start command: " + startCommand);
-        Log.i(TAG, "Stop command: " + stopCommand);
-
-        setIteration(NUM_ITERATIONS);
-        for (int i = 0; i < NUM_ITERATIONS; i++) {
-            // Stop any existing instances
-            runShellCommand(stopCommand);
-            // Start activity
-            runShellCommand(startCommand);
-
-            // Wait for the activity to start
-            sleep(SLEEP_TIME / 2);
-
-            // Start systrace
-            startTrace(mTestCaseName, i);
-
-            // Clear SurfaceFlinger buffer
-            Log.i(TAG, "Clearing SurfaceFlinger buffer");
-            SurfaceFlingerHelper.clearBuffer(APP_WINDOW_NAME);
-
-            // This is where user interactions would go, in this case just sleep
-            sleep(SLEEP_TIME);
-
-            // Dump SurfaceFlinger buffer
-            Log.i(TAG, "Dumping SurfaceFlinger buffer");
-            boolean result = SurfaceFlingerHelper.dumpFrameLatency(APP_WINDOW_NAME, true);
-            assertTrue("SurfaceFlingerHelper could not get timestamps", result);
-
-            // Stop systrace
-            endTrace();
-
-            // Record results
-            recordResults(mTestCaseName, i);
-        }
-        // Save aggregated results
-        saveResults(mTestCaseName);
-        // Stop any remaining instances
-        runShellCommand(stopCommand);
-    }
-}
diff --git a/hostsidetests/jank/src/android/jank/cts/CtsHostJankTest.java b/hostsidetests/jank/src/android/jank/cts/CtsHostJankTest.java
deleted file mode 100644
index 5a2d1ab..0000000
--- a/hostsidetests/jank/src/android/jank/cts/CtsHostJankTest.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * Copyright (C) 2013 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.jank.cts;
-
-import com.android.compatibility.common.util.MetricsReportLog;
-import com.android.compatibility.common.util.ResultType;
-import com.android.compatibility.common.util.ResultUnit;
-import com.android.cts.migration.MigrationHelper;
-import com.android.tradefed.build.IBuildInfo;
-import com.android.tradefed.device.ITestDevice;
-import com.android.tradefed.testtype.IAbi;
-import com.android.tradefed.testtype.IAbiReceiver;
-import com.android.tradefed.testtype.IBuildReceiver;
-import com.android.tradefed.testtype.IDeviceTest;
-
-import junit.framework.TestCase;
-
-import java.io.File;
-import java.util.HashMap;
-import java.util.Scanner;
-
-public abstract class CtsHostJankTest extends TestCase
-        implements IAbiReceiver, IDeviceTest, IBuildReceiver {
-
-    private static final String TAG = CtsHostJankTest.class.getSimpleName();
-    private static final String DEVICE_LOCATION = "/data/local/tmp/";
-    // FIXME uiautomator is deprecated and does not support --abi flag
-    private static final String RUN_UI_AUTOMATOR_CMD = "uiautomator runtest %s -c %s";
-    private final String mHostTestClass;
-    private final String mDeviceTestClass;
-    private final String mJarName;
-    private final String mJarPath;
-    protected ITestDevice mDevice;
-    protected IBuildInfo mBuild;
-    protected IAbi mAbi;
-
-    public CtsHostJankTest(String jarName, String deviceTestClass, String hostTestClass) {
-        this.mHostTestClass = hostTestClass;
-        this.mDeviceTestClass = deviceTestClass;
-        this.mJarName = jarName;
-        this.mJarPath = DEVICE_LOCATION + jarName;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public void setAbi(IAbi abi) {
-        mAbi = abi;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public void setBuild(IBuildInfo buildInfo) {
-        mBuild = buildInfo;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public void setDevice(ITestDevice device) {
-        mDevice = device;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public ITestDevice getDevice() {
-        return mDevice;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-        mDevice = getDevice();
-        // Push jar to device.
-        File jarFile = MigrationHelper.getTestFile(mBuild, mJarName);
-        boolean result = mDevice.pushFile(jarFile, mJarPath);
-        assertTrue("Failed to push file to " + mJarPath, result);
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    protected void tearDown() throws Exception {
-        // Delete jar from device.
-        mDevice.executeShellCommand("rm " + mJarPath);
-        super.tearDown();
-    }
-
-    public void runUiAutomatorTest(String testName) throws Exception {
-        // Delete any existing result files
-        mDevice.executeShellCommand("rm -r " + DEVICE_LOCATION + "UiJankinessTestsOutput.txt");
-
-        // Run ui automator test.
-        mDevice.executeShellCommand(
-                String.format(RUN_UI_AUTOMATOR_CMD, mJarName, mDeviceTestClass + "#" + testName));
-
-        // Pull result file across
-        File result = mDevice.pullFile(DEVICE_LOCATION + "UiJankinessTestsOutput.txt");
-        assertNotNull("Couldn't get result file", result);
-        // Parse result file
-        Scanner in = new Scanner(result);
-        HashMap<String, Double> results = new HashMap<String, Double>(4);
-        while (in.hasNextLine()) {
-            String[] parts = in.nextLine().split(":");
-            if (parts.length == 2) {
-                results.put(parts[0], Double.parseDouble(parts[1]));
-            }
-        }
-        in.close();
-        assertEquals("Could not parse the results file: ", 4, results.size());
-
-        double avgNumJanks = results.get("average number of jankiness");
-        double maxNumJanks = results.get("max number of jankiness");
-        double avgFrameRate = results.get("average frame rate");
-        double avgMaxAccFrames = results.get("average of max accumulated frames");
-
-        // Create and deliver the report.
-        MetricsReportLog report = new MetricsReportLog(mDevice.getSerialNumber(), mAbi.getName(),
-                mHostTestClass + "#" + testName);
-        report.addValue(
-                "Average Frame Rate", avgFrameRate, ResultType.HIGHER_BETTER, ResultUnit.COUNT);
-        report.addValue("Average of Maximum Accumulated Frames", avgMaxAccFrames,
-                ResultType.LOWER_BETTER, ResultUnit.COUNT);
-        report.addValue(
-                "Maximum Number of Janks", maxNumJanks, ResultType.LOWER_BETTER, ResultUnit.COUNT);
-        report.setSummary(
-                "Average Number of Janks", avgNumJanks, ResultType.LOWER_BETTER, ResultUnit.SCORE);
-        report.submit();
-    }
-
-}
diff --git a/hostsidetests/jank/src/android/jank/cts/opengl/CtsHostJankOpenGl.java b/hostsidetests/jank/src/android/jank/cts/opengl/CtsHostJankOpenGl.java
deleted file mode 100644
index 193d543..0000000
--- a/hostsidetests/jank/src/android/jank/cts/opengl/CtsHostJankOpenGl.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (C) 2013 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.jank.cts.opengl;
-
-import android.jank.cts.CtsHostJankTest;
-
-import com.android.compatibility.common.util.AbiUtils;
-import com.android.cts.migration.MigrationHelper;
-
-import java.io.File;
-
-public class CtsHostJankOpenGl extends CtsHostJankTest {
-
-    private static final String APK_PACKAGE = "android.opengl2.cts";
-    private static final String APK = "CtsOpenGlPerf2TestCases.apk";
-    private static final String PACKAGE = "android.jank.cts";
-    private static final String HOST_CLASS = CtsHostJankOpenGl.class.getName();
-    private static final String DEVICE_CLASS = PACKAGE + ".opengl.CtsDeviceJankOpenGl";
-    private static final String JAR_NAME = "CtsJankTestJar.jar";
-
-    public CtsHostJankOpenGl() {
-        super(JAR_NAME, DEVICE_CLASS, HOST_CLASS);
-    }
-
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-        // Install the app.
-        mDevice.uninstallPackage(APK_PACKAGE);
-        File app = MigrationHelper.getTestFile(mBuild, APK);
-        String[] options = {AbiUtils.createAbiFlag(mAbi.getName())};
-        mDevice.installPackage(app, false, options);
-    }
-
-    @Override
-    protected void tearDown() throws Exception {
-        // Uninstall the app.
-        mDevice.uninstallPackage(APK_PACKAGE);
-        super.tearDown();
-    }
-
-    public void testFullPipeline() throws Exception {
-        runUiAutomatorTest("testFullPipeline");
-    }
-
-    public void testPixelOutput() throws Exception {
-        runUiAutomatorTest("testPixelOutput");
-    }
-
-    public void testShaderPerf() throws Exception {
-        runUiAutomatorTest("testShaderPerf");
-    }
-
-    public void testContextSwitch() throws Exception {
-        runUiAutomatorTest("testContextSwitch");
-    }
-}