Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bb996d4a authored by Eric Biggers's avatar Eric Biggers
Browse files

Ensure PropertyInvalidatedCache test mode in all locksettings tests

WeakEscrowTokenTests (and possibly other test classes in
com.android.server.locksettings) was missing a call to
PropertyInvalidatedCache.disableForTestMode().  There are other tests in
com.android.server.locksettings that do make that call, and it applies
to the whole process.  So WeakEscrowTokenTests was relying on the
implicit test ordering, and it failed when run by itself.

To fix this, move the enabling of test mode into
BaseLockSettingsServiceTests, which is the base class that all the
relevant test classes inherit from.

Additionally, switch from a process-wide toggle to a per-test toggle.
That ensures implicit test ordering is no longer being relied on.

Test: atest FrameworksServicesTests:WeakEscrowTokenTests
Test: atest FrameworksServicesTests:com.android.server.locksettings
Bug: 418862901
Flag: TEST_ONLY
Change-Id: I30f451ff46b3a46bd5a89f6d618df69db6506f75
parent c61d5377
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment