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

Commit 0881a761 authored by Juan Sebastian Martinez's avatar Juan Sebastian Martinez
Browse files

Optimizing MagneticRowManagerImplTest by more than 90%

Two optimizations can be done to improve the running time of the Unit
tests. First, it is not necessary to fully inflate a real
ExpandableNotificationRow backed by a Notification and NotificationEntry
to test the logic of its magnetic behavior. Significant improvements are
achieved by replacing the rows in the tests with mocks, each with a
reference to a testable MagneticRowListener.

Second, we can replace the NotificationTargetsHelper dependency with a
testable object that allows to set the magnetic targets during test
setup. This avoids having to run the target finding algorithm for each
test and makes NotificationTargetsHelper more testable. This CL makes
NotificationTargetsHelper an interface to achieve this result.

Test: NotificationTargetsHelperTest
Test: MagneticRowManagerImplTest
Test: Verified test run about 90% faster when using atest
Bug: 427255241
Flag: NONE improving unit tests
Change-Id: Iaa72066e626d571f69af755695bfe4f5d68183a1
parent 182e1409
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