diff options
author | Guang Zhu <guangzhu@google.com> | 2014-08-08 18:33:09 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-08-08 16:09:03 +0000 |
commit | 4ed52ab7522708c99bdcc59a74de277701b13f3d (patch) | |
tree | 1776e74066d670094987c6487634a7d0d593dc66 /tests | |
parent | d18a1da18d1f92acc2669f936da00cd66657e44b (diff) | |
parent | e2a03fe43d1f8eb5a6ada046870dcc35392d8f17 (diff) | |
download | frameworks_base-4ed52ab7522708c99bdcc59a74de277701b13f3d.zip frameworks_base-4ed52ab7522708c99bdcc59a74de277701b13f3d.tar.gz frameworks_base-4ed52ab7522708c99bdcc59a74de277701b13f3d.tar.bz2 |
Merge "freeze screen rotation during memory and app launch test" into lmp-dev
Diffstat (limited to 'tests')
-rw-r--r-- | tests/AppLaunch/src/com/android/tests/applaunch/AppLaunch.java | 13 | ||||
-rw-r--r-- | tests/MemoryUsage/src/com/android/tests/memoryusage/MemoryUsageTest.java | 13 |
2 files changed, 26 insertions, 0 deletions
diff --git a/tests/AppLaunch/src/com/android/tests/applaunch/AppLaunch.java b/tests/AppLaunch/src/com/android/tests/applaunch/AppLaunch.java index dfb8070..a209d6c 100644 --- a/tests/AppLaunch/src/com/android/tests/applaunch/AppLaunch.java +++ b/tests/AppLaunch/src/com/android/tests/applaunch/AppLaunch.java @@ -22,6 +22,7 @@ import android.app.ActivityManager.ProcessErrorStateInfo; import android.app.ActivityManagerNative; import android.app.IActivityManager; import android.app.IActivityManager.WaitResult; +import android.app.UiAutomation; import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; @@ -72,6 +73,18 @@ public class AppLaunch extends InstrumentationTestCase { private Bundle mResult = new Bundle(); private Set<String> mRequiredAccounts; + @Override + protected void setUp() throws Exception { + super.setUp(); + getInstrumentation().getUiAutomation().setRotation(UiAutomation.ROTATION_FREEZE_0); + } + + @Override + protected void tearDown() throws Exception { + getInstrumentation().getUiAutomation().setRotation(UiAutomation.ROTATION_UNFREEZE); + super.tearDown(); + } + public void testMeasureStartUpTime() throws RemoteException, NameNotFoundException { InstrumentationTestRunner instrumentation = (InstrumentationTestRunner)getInstrumentation(); diff --git a/tests/MemoryUsage/src/com/android/tests/memoryusage/MemoryUsageTest.java b/tests/MemoryUsage/src/com/android/tests/memoryusage/MemoryUsageTest.java index 051ed0e..f582a91 100644 --- a/tests/MemoryUsage/src/com/android/tests/memoryusage/MemoryUsageTest.java +++ b/tests/MemoryUsage/src/com/android/tests/memoryusage/MemoryUsageTest.java @@ -20,6 +20,7 @@ import android.app.ActivityManager.ProcessErrorStateInfo; import android.app.ActivityManager.RunningAppProcessInfo; import android.app.ActivityManagerNative; import android.app.IActivityManager; +import android.app.UiAutomation; import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; @@ -67,6 +68,18 @@ public class MemoryUsageTest extends InstrumentationTestCase { private Set<String> mPersistentProcesses; private IActivityManager mAm; + @Override + protected void setUp() throws Exception { + super.setUp(); + getInstrumentation().getUiAutomation().setRotation(UiAutomation.ROTATION_FREEZE_0); + } + + @Override + protected void tearDown() throws Exception { + getInstrumentation().getUiAutomation().setRotation(UiAutomation.ROTATION_UNFREEZE); + super.tearDown(); + } + public void testMemory() { MemoryUsageInstrumentation instrumentation = (MemoryUsageInstrumentation) getInstrumentation(); |