am a61a2b3a: am 011caab6: Merge "freeze screen rotation during memory and app launch test" into lmp-dev

* commit 'a61a2b3a3c437fa41e3916eb4aa423cf70604532':
  freeze screen rotation during memory and app launch test
This commit is contained in:
Guang Zhu
2014-08-08 18:46:46 +00:00
committed by Android Git Automerger
2 changed files with 26 additions and 0 deletions

View File

@@ -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();

View File

@@ -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();