commit | b382c5c4c82213b2fc3f2c50483bebfb34e09218 | [log] [tgz] |
---|---|---|
author | Felipe Leme <felipeal@google.com> | Wed Mar 11 15:35:03 2020 -0700 |
committer | Felipe Leme <felipeal@google.com> | Wed Mar 11 23:02:46 2020 +0000 |
tree | 1d7a79b210d1ca88a2d725e5e42c3b60e4202774 | |
parent | b93cf9f267b5992d1931e80816fa8274760b6893 [diff] |
Refactored user-switching tests on CarPowerManagementServiceTest. They were using the HAL signals to trigger user switch, which was too slow (~9.5s for each test method); with this change, most tests now call switchUserOnResumeIfNecessary() directly, which drops their duration to ~3s - just the original test (testSleepEntryAndWakeUpForProcessing(), which was re-added) exercises the full workflow. Before this change, it would take ~3:33 minutes to run the tests: real 3m33.778s user 0m9.021s sys 0m2.459s After the change, it dropped to ~1:52: real 1m52.760s user 0m8.828s sys 0m1.890s Test: atest CarServiceUnitTest:com.android.car.CarPowerManagementServiceTest Bug: 151223325 Change-Id: I00b45a8c13ecfdb268a75586a05d818cef0c51db
Native (C++) code format is required to be compatible with .clang-format file. Run
git clang-format --style=file --extension='h,cpp,cc' HEAD~
Note that clang-format is not desirable for Android java files. Therefore the command line above is limited to specific extensions.