diff options
| author | 2023-01-05 18:14:20 +0000 | |
|---|---|---|
| committer | 2023-01-05 18:14:20 +0000 | |
| commit | a67139f886cc40fe887f009240be1affedf024fe (patch) | |
| tree | 974580d1356c3708633a2abcc753614389f67671 | |
| parent | f45b9cae4bcb2af1e3f6e80afd172521d07feda8 (diff) | |
Add new version of startUser performance test
Similar to what was done for switchUser, this commit adds a new version
of the startUser test. In this variation, a wait for cool down was added
in between iterations.
Bug: 261621873
Test: atest UserLifecycleTests#startUser_realistic
Change-Id: Ia4ff7ed2df7b209175185794eac0cb17630ddc9e
| -rw-r--r-- | apct-tests/perftests/multiuser/src/android/multiuser/UserLifecycleTests.java | 26 |
1 files changed, 26 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 3f9b54cb8578..c6e7c3546df5 100644 --- a/apct-tests/perftests/multiuser/src/android/multiuser/UserLifecycleTests.java +++ b/apct-tests/perftests/multiuser/src/android/multiuser/UserLifecycleTests.java @@ -225,6 +225,32 @@ public class UserLifecycleTests { } /** + * Tests starting an uninitialized user, with wait times in between iterations. + * Measures the time until ACTION_USER_STARTED is received. + */ + @Test(timeout = TIMEOUT_MAX_TEST_TIME_MS) + public void startUser_realistic() throws RemoteException { + while (mRunner.keepRunning()) { + mRunner.pauseTiming(); + final int userId = createUserNoFlags(); + + waitForBroadcastIdle(); + runThenWaitForBroadcasts(userId, () -> { + mRunner.resumeTiming(); + Log.i(TAG, "Starting timer"); + + mIam.startUserInBackground(userId); + }, Intent.ACTION_USER_STARTED); + + mRunner.pauseTiming(); + Log.i(TAG, "Stopping timer"); + removeUser(userId); + waitCoolDownPeriod(); + mRunner.resumeTimingForNextIteration(); + } + } + + /** * Tests starting & unlocking an uninitialized user. * Measures the time until unlock listener is triggered and user is unlocked. */ |