diff options
author | Tsu Chiang Chuang <tsu@google.com> | 2011-08-06 13:35:26 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-08-06 13:35:26 -0700 |
commit | c29c8462b1f56558a4e357975fa7463e66bce47e (patch) | |
tree | 29972c94eeb0901452118b0ff3346074cd833091 | |
parent | ecd14a3db433003d835a33cb1f9c5624904ab5fa (diff) | |
parent | ee8caea24b3ac28f1074cebdaef43708a91538a7 (diff) | |
download | packages_apps_trebuchet-c29c8462b1f56558a4e357975fa7463e66bce47e.zip packages_apps_trebuchet-c29c8462b1f56558a4e357975fa7463e66bce47e.tar.gz packages_apps_trebuchet-c29c8462b1f56558a4e357975fa7463e66bce47e.tar.bz2 |
Merge "changing test to use hidden test api annotations."
-rw-r--r-- | tests/stress/Android.mk | 2 | ||||
-rw-r--r-- | tests/stress/AndroidManifest.xml | 2 | ||||
-rw-r--r-- | tests/stress/src/com/android/launcher2/stress/LauncherRotationStressTest.java | 27 |
3 files changed, 11 insertions, 20 deletions
diff --git a/tests/stress/Android.mk b/tests/stress/Android.mk index da22bb9..68289bd 100644 --- a/tests/stress/Android.mk +++ b/tests/stress/Android.mk @@ -28,6 +28,4 @@ LOCAL_CERTIFICATE := shared LOCAL_INSTRUMENTATION_FOR := Launcher2 -LOCAL_SDK_VERSION := current - include $(BUILD_PACKAGE) diff --git a/tests/stress/AndroidManifest.xml b/tests/stress/AndroidManifest.xml index ce5dbe4..0df3a9d 100644 --- a/tests/stress/AndroidManifest.xml +++ b/tests/stress/AndroidManifest.xml @@ -17,8 +17,6 @@ <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.android.launcher.stress.launcherrotation"> - <uses-sdk android:minSdkVersion="8" /> - <application> <uses-library android:name="android.test.runner" /> </application> diff --git a/tests/stress/src/com/android/launcher2/stress/LauncherRotationStressTest.java b/tests/stress/src/com/android/launcher2/stress/LauncherRotationStressTest.java index 3d787f2..d21fd53 100644 --- a/tests/stress/src/com/android/launcher2/stress/LauncherRotationStressTest.java +++ b/tests/stress/src/com/android/launcher2/stress/LauncherRotationStressTest.java @@ -22,7 +22,7 @@ import com.android.launcher2.Launcher; import android.content.pm.ActivityInfo; import android.os.SystemClock; import android.test.ActivityInstrumentationTestCase2; -import android.test.TimedTest; +import android.test.RepetitiveTest; import android.util.Log; /** @@ -31,6 +31,7 @@ import android.util.Log; public class LauncherRotationStressTest extends ActivityInstrumentationTestCase2<Launcher> { private static final int NUM_ITERATIONS = 50; + private static final int WAIT_TIME_MS = 500; private static final String LOG_TAG = "LauncherRotationStressTest"; public LauncherRotationStressTest() { @@ -47,22 +48,16 @@ public class LauncherRotationStressTest extends ActivityInstrumentationTestCase2 super.tearDown(); } - @TimedTest(includeDetailedStats=true) + @RepetitiveTest(numIterations=NUM_ITERATIONS) public void testLauncherRotationStress() throws Exception { Launcher launcher = getActivity(); - for (int i = 0; i < NUM_ITERATIONS; i++) { - Log.i(LOG_TAG, "Starting LauncherRotationStressTest " + (i + 1) + " of " + - NUM_ITERATIONS); - getInstrumentation().waitForIdleSync(); - SystemClock.sleep(500); - launcher.setRequestedOrientation( - ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); - getInstrumentation().waitForIdleSync(); - SystemClock.sleep(500); - launcher.setRequestedOrientation( - ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); - Log.i(LOG_TAG, "Finished LauncherRotationStressTest " + (i + 1) + " of " + - NUM_ITERATIONS); - } + getInstrumentation().waitForIdleSync(); + SystemClock.sleep(WAIT_TIME_MS); + launcher.setRequestedOrientation( + ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); + getInstrumentation().waitForIdleSync(); + SystemClock.sleep(WAIT_TIME_MS); + launcher.setRequestedOrientation( + ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); } } |