Rename instr argument 'repeat' to 'iterations'

The argument means the number of test iterations for camera
stress testing. Renamed for easier understanding of the argument.

Change-Id: I3247e35f8640c98db5c8438c3fc79a45073d9623
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/Camera2SurfaceViewTestCase.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/Camera2SurfaceViewTestCase.java
index 74da2c9..e718742 100644
--- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/Camera2SurfaceViewTestCase.java
+++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/Camera2SurfaceViewTestCase.java
@@ -90,7 +90,7 @@
     private static final int WAIT_FOR_SURFACE_CHANGE_TIMEOUT_MS = 1000;
 
     // Instrumentation arguments
-    protected static final String ARG_KEY_REPEAT = "repeat";
+    protected static final String ARG_KEY_ITERATIONS = "iterations";
     protected static final String ARG_KEY_WAIT_INTERVAL_MS = "waitIntervalMs";
     protected static final String ARG_KEY_RESULT_TO_FILE = "resultToFile";
 
@@ -126,8 +126,8 @@
 
     protected WindowManager mWindowManager;
 
-    // Repeat tests a given times. Default to 1.
-    protected int mRepeat = 1;
+    // Set the number of iterations to run stress testing. Default to 1.
+    protected int mIterations = 1;
     // The interval between test iterations used for stress test.
     protected long mTestWaitIntervalMs = 1 * 1000;  // 1 sec
     protected boolean mWriteToFile = true;
@@ -165,10 +165,10 @@
 
         mWindowManager = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);
 
-        mRepeat = getArgumentsAsNumber(ARG_KEY_REPEAT, 1).intValue();
+        mIterations = getArgumentsAsNumber(ARG_KEY_ITERATIONS, 1).intValue();
         mTestWaitIntervalMs = getArgumentsAsNumber(ARG_KEY_WAIT_INTERVAL_MS, 1000).longValue();
         mWriteToFile = getArgumentsAsBoolean(ARG_KEY_RESULT_TO_FILE, true);
-        Log.i(TAG, "Argument: repeat count=" + mRepeat);
+        Log.i(TAG, "Argument: iteration count=" + mIterations);
         Log.i(TAG, "Argument: interval (ms)=" + mTestWaitIntervalMs);
         Log.i(TAG, "Argument: result to file=" + (mWriteToFile ? "true" : "false"));
         mResultPrinter = new CameraTestResultPrinter(getInstrumentation(), mWriteToFile);
@@ -790,8 +790,8 @@
         return defaultValue;
     }
 
-    protected int getRepeatCount() {
-        return mRepeat;
+    protected int getIterationCount() {
+        return mIterations;
     }
 
     protected long getTestWaitIntervalMs() {
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/stress/Camera2CaptureRequestTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/stress/Camera2CaptureRequestTest.java
index b152975..ebfd92e 100644
--- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/stress/Camera2CaptureRequestTest.java
+++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/stress/Camera2CaptureRequestTest.java
@@ -24,7 +24,6 @@
 import android.hardware.camera2.CaptureRequest;
 import android.hardware.camera2.CaptureResult;
 import android.util.Log;
-import android.util.Rational;
 import android.util.Size;
 
 import java.util.Arrays;
@@ -47,7 +46,7 @@
  *
  * adb shell am instrument \
  *    -e class com.android.mediaframeworktest.stress.Camera2CaptureRequestTest#testAeModeAndLock \
- *    -e repeat 10 \
+ *    -e iterations 10 \
  *    -e waitIntervalMs 1000 \
  *    -e resultToFile false \
  *    -r -w com.android.mediaframeworktest/.Camera2InstrumentationTestRunner
@@ -100,16 +99,16 @@
                 updatePreviewSurface(maxPreviewSz);
 
                 // Test iteration starts...
-                for (int repeat = 0; repeat < getRepeatCount(); ++repeat) {
-                    Log.v(TAG, String.format("AE mode and lock: %d/%d", repeat + 1,
-                            getRepeatCount()));
+                for (int iteration = 0; iteration < getIterationCount(); ++iteration) {
+                    Log.v(TAG, String.format("AE mode and lock: %d/%d", iteration + 1,
+                            getIterationCount()));
 
                     // Test aeMode and lock
                     int[] aeModes = mStaticInfo.getAeAvailableModesChecked();
                     for (int mode : aeModes) {
                         aeModeAndLockTestByMode(mode);
                     }
-                    getResultPrinter().printStatus(getRepeatCount(), repeat + 1, mCameraIds[i]);
+                    getResultPrinter().printStatus(getIterationCount(), iteration + 1, mCameraIds[i]);
                     Thread.sleep(getTestWaitIntervalMs());
                 }
             } finally {
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/stress/Camera2RecordingTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/stress/Camera2RecordingTest.java
index e7c91cf..a9b6bfd 100644
--- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/stress/Camera2RecordingTest.java
+++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/stress/Camera2RecordingTest.java
@@ -67,7 +67,7 @@
  *
  * adb shell am instrument \
  *    -e class com.android.mediaframeworktest.stress.Camera2RecordingTest#testBasicRecording \
- *    -e repeat 10 \
+ *    -e iterations 10 \
  *    -e waitIntervalMs 1000 \
  *    -e resultToFile false \
  *    -r -w com.android.mediaframeworktest/.Camera2InstrumentationTestRunner
@@ -142,11 +142,12 @@
                 initSupportedVideoSize(mCameraIds[i]);
 
                 // Test iteration starts...
-                for (int repeat = 0; repeat < getRepeatCount(); ++repeat) {
-                    Log.v(TAG, String.format("Recording video: %d/%d", repeat + 1,
-                            getRepeatCount()));
+                for (int iteration = 0; iteration < getIterationCount(); ++iteration) {
+                    Log.v(TAG, String.format("Recording video: %d/%d", iteration + 1,
+                            getIterationCount()));
                     basicRecordingTestByCamera(mCamcorderProfileList, useVideoStab);
-                    getResultPrinter().printStatus(getRepeatCount(), repeat + 1, mCameraIds[i]);
+                    getResultPrinter().printStatus(getIterationCount(), iteration + 1,
+                            mCameraIds[i]);
                     Thread.sleep(getTestWaitIntervalMs());
                 }
             } finally {
@@ -206,9 +207,9 @@
                 }
 
                 // Test iteration starts...
-                for (int repeat = 0; repeat < getRepeatCount(); ++repeat) {
-                    Log.v(TAG, String.format("Constrained high speed recording: %d/%d", repeat + 1,
-                            getRepeatCount()));
+                for (int iteration = 0; iteration < getIterationCount(); ++iteration) {
+                    Log.v(TAG, String.format("Constrained high speed recording: %d/%d",
+                            iteration + 1, getIterationCount()));
 
                     StreamConfigurationMap config =
                             mStaticInfo.getValueFromKeyNonNull(
@@ -257,7 +258,7 @@
                             validateRecording(size, durationMs);
                         }
 
-                    getResultPrinter().printStatus(getRepeatCount(), repeat + 1, id);
+                    getResultPrinter().printStatus(getIterationCount(), iteration + 1, id);
                     Thread.sleep(getTestWaitIntervalMs());
                     }
                 }
@@ -481,11 +482,11 @@
                     initSupportedVideoSize(id);
 
                     // Test iteration starts...
-                    for (int repeat = 0; repeat < getRepeatCount(); ++repeat) {
-                        Log.v(TAG, String.format("Video snapshot: %d/%d", repeat + 1,
-                                getRepeatCount()));
+                    for (int iteration = 0; iteration < getIterationCount(); ++iteration) {
+                        Log.v(TAG, String.format("Video snapshot: %d/%d", iteration + 1,
+                                getIterationCount()));
                         videoSnapshotTestByCamera(burstTest);
-                        getResultPrinter().printStatus(getRepeatCount(), repeat + 1, id);
+                        getResultPrinter().printStatus(getIterationCount(), iteration + 1, id);
                         Thread.sleep(getTestWaitIntervalMs());
                     }
                 } finally {
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/stress/Camera2ReprocessCaptureTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/stress/Camera2ReprocessCaptureTest.java
index 2dac371..8f94897 100644
--- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/stress/Camera2ReprocessCaptureTest.java
+++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/stress/Camera2ReprocessCaptureTest.java
@@ -58,7 +58,7 @@
  * adb shell am instrument \
  *    -e class \
  *    com.android.mediaframeworktest.stress.Camera2StillCaptureTest#Camera2ReprocessCaptureTest \
- *    -e repeat 1 \
+ *    -e iterations 1 \
  *    -e waitIntervalMs 1000 \
  *    -e resultToFile false \
  *    -r -w com.android.mediaframeworktest/.Camera2InstrumentationTestRunner
@@ -110,12 +110,12 @@
             }
 
             // Test iteration starts...
-            for (int repeat = 0; repeat < getRepeatCount(); ++repeat) {
-                Log.v(TAG, String.format("Reprocessing YUV to JPEG: %d/%d", repeat + 1,
-                        getRepeatCount()));
+            for (int iteration = 0; iteration < getIterationCount(); ++iteration) {
+                Log.v(TAG, String.format("Reprocessing YUV to JPEG: %d/%d", iteration + 1,
+                        getIterationCount()));
                 // YUV_420_888 -> JPEG must be supported.
                 testBasicReprocessing(id, ImageFormat.YUV_420_888, ImageFormat.JPEG);
-                getResultPrinter().printStatus(getRepeatCount(), repeat + 1, id);
+                getResultPrinter().printStatus(getIterationCount(), iteration + 1, id);
                 Thread.sleep(getTestWaitIntervalMs());
             }
         }
@@ -131,12 +131,12 @@
             }
 
             // Test iteration starts...
-            for (int repeat = 0; repeat < getRepeatCount(); ++repeat) {
-                Log.v(TAG, String.format("Reprocessing OPAQUE to JPEG: %d/%d", repeat + 1,
-                        getRepeatCount()));
+            for (int iteration = 0; iteration < getIterationCount(); ++iteration) {
+                Log.v(TAG, String.format("Reprocessing OPAQUE to JPEG: %d/%d", iteration + 1,
+                        getIterationCount()));
                 // OPAQUE -> JPEG must be supported.
                 testBasicReprocessing(id, ImageFormat.PRIVATE, ImageFormat.JPEG);
-                getResultPrinter().printStatus(getRepeatCount(), repeat + 1, id);
+                getResultPrinter().printStatus(getIterationCount(), iteration + 1, id);
                 Thread.sleep(getTestWaitIntervalMs());
             }
 
@@ -157,12 +157,12 @@
                 openDevice(id);
 
                 // Test iteration starts...
-                for (int repeat = 0; repeat < getRepeatCount(); ++repeat) {
+                for (int iteration = 0; iteration < getIterationCount(); ++iteration) {
                     Log.v(TAG, String.format("Reprocessing size format with preview: %d/%d",
-                            repeat + 1, getRepeatCount()));
+                            iteration + 1, getIterationCount()));
                     testReprocessingAllCombinations(id, mOrderedPreviewSizes.get(0),
                             CaptureTestCase.SINGLE_SHOT);
-                    getResultPrinter().printStatus(getRepeatCount(), repeat + 1, id);
+                    getResultPrinter().printStatus(getIterationCount(), iteration + 1, id);
                     Thread.sleep(getTestWaitIntervalMs());
                 }
             } finally {
@@ -185,16 +185,16 @@
                 openDevice(id);
 
                 // Test iteration starts...
-                for (int repeat = 0; repeat < getRepeatCount(); ++repeat) {
+                for (int iteration = 0; iteration < getIterationCount(); ++iteration) {
                     Log.v(TAG, String.format("Reprocessing mixed burst with or without preview: "
-                            + "%d/%d", repeat + 1, getRepeatCount()));
+                            + "%d/%d", iteration + 1, getIterationCount()));
                     // no preview
                     testReprocessingAllCombinations(id, /*previewSize*/null,
                             CaptureTestCase.MIXED_BURST);
                     // with preview
                     testReprocessingAllCombinations(id, mOrderedPreviewSizes.get(0),
                             CaptureTestCase.MIXED_BURST);
-                    getResultPrinter().printStatus(getRepeatCount(), repeat + 1, id);
+                    getResultPrinter().printStatus(getIterationCount(), iteration + 1, id);
                     Thread.sleep(getTestWaitIntervalMs());
                 }
             } finally {
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/stress/Camera2StillCaptureTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/stress/Camera2StillCaptureTest.java
index 16dfb2b..812543b 100644
--- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/stress/Camera2StillCaptureTest.java
+++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/stress/Camera2StillCaptureTest.java
@@ -59,7 +59,7 @@
  *
  * adb shell am instrument \
  *    -e class com.android.mediaframeworktest.stress.Camera2StillCaptureTest#testTakePicture \
- *    -e repeat 200 \
+ *    -e iterations 200 \
  *    -e waitIntervalMs 1000 \
  *    -e resultToFile false \
  *    -r -w com.android.mediaframeworktest/.Camera2InstrumentationTestRunner
@@ -108,12 +108,12 @@
                 }
 
                 // Test iteration starts...
-                for (int repeat = 0; repeat < getRepeatCount(); ++repeat) {
-                    Log.v(TAG, String.format("Taking pictures: %d/%d", repeat + 1,
-                            getRepeatCount()));
+                for (int iteration = 0; iteration < getIterationCount(); ++iteration) {
+                    Log.v(TAG, String.format("Taking pictures: %d/%d", iteration + 1,
+                            getIterationCount()));
                     takePictureTestByCamera(/*aeRegions*/null, /*awbRegions*/null,
                             /*afRegions*/null);
-                    getResultPrinter().printStatus(getRepeatCount(), repeat + 1, id);
+                    getResultPrinter().printStatus(getIterationCount(), iteration + 1, id);
                     Thread.sleep(getTestWaitIntervalMs());
                 }
             } finally {
@@ -144,11 +144,12 @@
                 }
 
                 // Test iteration starts...
-                for (int repeat = 0; repeat < getRepeatCount(); ++repeat) {
-                    Log.v(TAG, String.format("Taking full RAW pictures: %d/%d", repeat + 1,
-                            getRepeatCount()));
+                for (int iteration = 0; iteration < getIterationCount(); ++iteration) {
+                    Log.v(TAG, String.format("Taking full RAW pictures: %d/%d", iteration + 1,
+                            getIterationCount()));
                     fullRawCaptureTestByCamera();
-                    getResultPrinter().printStatus(getRepeatCount(), repeat + 1, mCameraIds[i]);
+                    getResultPrinter().printStatus(getIterationCount(), iteration + 1,
+                            mCameraIds[i]);
                     Thread.sleep(getTestWaitIntervalMs());
                 }
             } finally {