Using the new, modern architecture user switcher UI, we implement a UI
screenshot diff test for it. This is a prerequisite for the next step,
where we replace the XML file and view-binder code with a Jetpack
Compose implementation.
Bug: 243843440
Test: N/A this CL is a test
Change-Id: I2831129f44702007be64133a3edcd418e30bd4c1
AmbientState is a critical state holder for system holder but does not contains unit tests. The tests here are extracted from the attempt to convert AmbientState to Kotlin, and introduce a basic unit test coverage that we can build upon to increase changes confidence. Because AmbientState is a simple state holder, the tests are mostly checking property modifications.
We did not include test for any property that does not contain a custom getter or setter.
Test: atest ~/tm-qpr-dev/frameworks/base/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/AmbientStateTest.kt
Fixes: 242754590
Change-Id: Ieb95b9845ee044ae293a3934b9a688c879c64249
Implements addListener/removeListener with extensive tests.
Does not attempt to simulate 'requestNoRestart' option.
Bug: 244205755
Test: atest FakeFeatureFlagsTest
Change-Id: Ida5911279853744b23c6b139848e99bebc7e6cb2
Prox-gate the tap and double tap to wake gestures
from pulsing/AoD2.
Enable FalsingCollector logs:
adb shell setprop log.tag.FalsingCollector DEBUG
Test: manually trigger quickpickup (or receive a notification on AoD),
cover the prox sensor, and then tap the screen - see device won't wake up
Test: atest NotificationShadeWindowViewControllerTest BrightLineFalsingManagerTest PulsingGestureListenerTest
Fixes: 242125976
Change-Id: I520df509b7804d765807477968257c94f55ef634
This CL provides most of the implementation of the QS FooterActions
following the modern Android architecture. In particular, this CL
includes:
- repositories in the data layer.
- an interactor in the domain layer.
- a view model in the ui layer.
The ViewBinder is added in ag/19674347, given that it comes together
with changes to the existing XML files.
Note that after this CL, the new implementation will still not be used
as it won't be wired yet. This is done in ag/19674347.
The highest value of the tests is in FooterActionsViewModelTest, which
focuses on testing the *state* (view model) of the footer actions using
the *real implementation* of the repositories, interactor and viewModel
all together. To do so, I implemented a FooterActionsUtils class that
allows to *easily* create real implementations of those repositories,
interactor and view model, without requiring the caller to provide any
parameter. I believe that this is even better than introducing new
fakes, and it should hopefully lead us towards using more and more of
the real implementations in our tests, and less and less of fakes/mocks,
making the tests much more useful. Of course, I still had to use fake &
mocks for the classes I'm calling to and for which instantiating the
actual object is too painful. As you can see, there are no test files
for the repositories: given that we already use the real implementations
in the ViewModel tests, they are defacto already tested.
I still added some tests on *interactions* (not *state*) in
FooterActionsInteractorTest. Even though I believe those tests don't
provide much value (they are merely a copy/paste of the implementation),
I preferred keeping the same coverage as the current tests (some of
which are going to be removed in ag/19674347).
Note that the business logic contained in this CL was mostly copy/pasted
from the current implementation, as I wanted to make sure that this is
going to be a pure refactoring that does not change the logic of this
feature. Still, I left some TODOs in the code for potential
improvements.
Bug: 242040009
Test: atest FooterActionsViewModelTest
Test: atest FooterActionsInteractorTest
Change-Id: Ia0bdf9824e098ad6604709f5db87576437b0a904
This CL adds fake implementations for:
- FgsManagerController
- UserTracker
- SecurityController
- UserInfoController
It also adds a wrapper around a mocked UserSwitcherController to make it
easier to mock in tests while still handling callbacks.
Those fakes are going to be used to test the new implementation of the
QSFooterActions, which are going to be refactored using the modern
Android architecture. See ag/19678215 to see how they are used.
Bug: 242040009
Test: atest FgsManagerControllerTest
Test: atest FooterActionsViewModelTest
Test: atest FooterActionsInteractorTest
Change-Id: I0a3ef36de81c1bd48f33d4d234a4ee903bf40fc6
This CL ensures that we don't try to animate a dialog into an Activity
if the device is currently locked.
Test: atest DialogLaunchAnimatorTest
Bug: 240572073
Change-Id: I5adf650cf9f42781803dce1bebe14b2a78f43fff
* apply and commit both act in the same way, applying the contents of
the Editor synchronously
* data is stored in memory in the instance
* listeners are dispatched synchronously on the same thread that calls
apply/commit
Test: atest FakeSharedPreferencesTest
Bug: 180126509
Change-Id: Ie443f6269a9aa6d699631d8524bfa9fe6b3474e4
This CL moves all the SystemUI-test-utils files to a separate
SystemUI/tests/utils/ directory. This paves the way towards making this
filegroup a reusable library instead.
The files have been move using a small bash script [1].
[1] https://paste.googleplex.com/5565628199993344
Bug: 240431193
Test: m SystemUI-tests SystemUIGoogleTests SystemUIGoogleScreenshotTests ArcSystemUI-test
Change-Id: I43ff578be211f1ef3f9c5bffd5c65771ef1492dc