diff options
author | Bookatz <bookatz@google.com> | 2019-05-30 10:04:30 -0700 |
---|---|---|
committer | Bookatz <bookatz@google.com> | 2019-05-31 13:34:04 -0700 |
commit | 5f8701915733df4e33de4bb6b709f8e38b1ebe22 (patch) | |
tree | 1867d3f2cfc8a264dff787c6a33fd907c793b8c9 /apct-tests | |
parent | 4c07595040008ecf162a909bc1eb60b0f66c8978 (diff) |
Multiuser perf test: re-launching app in profile
Times starting (unlocking) and launching a previously-launched app
in an already-created, but no-longer-running, profile. This represents
how long it would take to immediately start a profile and launch an app
within it for a re-used profile.
Bug: 129857107
Test: atest multiuser.UserLifecycleTests#managedProfileUnlockAndLaunchApp_stopped
Change-Id: I34cc9aeef07ea6481f4d168cda47b5dea69a5a74
Diffstat (limited to 'apct-tests')
-rw-r--r-- | apct-tests/perftests/multiuser/src/android/multiuser/UserLifecycleTests.java | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/apct-tests/perftests/multiuser/src/android/multiuser/UserLifecycleTests.java b/apct-tests/perftests/multiuser/src/android/multiuser/UserLifecycleTests.java index ee4e1e43c8e6..e2ef7a11b3a0 100644 --- a/apct-tests/perftests/multiuser/src/android/multiuser/UserLifecycleTests.java +++ b/apct-tests/perftests/multiuser/src/android/multiuser/UserLifecycleTests.java @@ -326,6 +326,34 @@ public class UserLifecycleTests { } } + /** + * Tests starting (unlocking) and launching a previously-launched app + * in an already-created, but no-longer-running, profile. + * A sort of combination of {@link #managedProfileUnlockAndLaunchApp} and + * {@link #managedProfileUnlock_stopped}}. + */ + @Test + public void managedProfileUnlockAndLaunchApp_stopped() throws Exception { + while (mRunner.keepRunning()) { + mRunner.pauseTiming(); + final int userId = createManagedProfile(); + WindowManagerGlobal.getWindowManagerService().dismissKeyguard(null, null); + installPreexistingApp(userId, DUMMY_PACKAGE_NAME); + startUserInBackground(userId); + startApp(userId, DUMMY_PACKAGE_NAME); + stopUser(userId, true); + TimeUnit.SECONDS.sleep(1); // Brief cool-down before re-starting profile. + mRunner.resumeTiming(); + + startUserInBackground(userId); + startApp(userId, DUMMY_PACKAGE_NAME); + + mRunner.pauseTiming(); + removeUser(userId); + mRunner.resumeTiming(); + } + } + /** Tests installing a pre-existing app in a newly-created profile. */ @Test public void managedProfileInstall() throws Exception { |