Files
app_Settings/tests
Chun-Ku Lin c8c67d731f Fix ToggleScreenMagnificationPreferenceFragmentTest
- Prevent mocking ToggleScreenMagnificationPreferenceFragment for test
- Use Robolectric's way to launch the fragment so that the fragment
  contains necessary setup

**Root cause**
- We called onCreateView directly in the test without the necessary setup
  in onCreate, which causes the FooterPreferenceController not being
  initialized.
- We created a spyContext that returns a mock PackageManager, however,
  in the test execution, we didn't mock the context used by the fragment
  under test. Hence, the fragment didn't use the mock PackageManager in
  test.

Bug: 284209879
Test: atest ToggleScreenMagnificationPreferenceFragmentTest --iterations
5

Change-Id: I7e71a03177526f5bb0c20a58855a7dfdffc2a22f
2023-06-02 03:04:37 +00:00
..