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
2022-04-14 09:55:36 +00:00
2019-04-04 12:49:15 -07:00
2019-11-25 20:28:35 +09:00
2023-05-24 07:41:50 +00:00
2022-10-06 09:10:38 -07:00
Description
No description provided
3.1 GiB
Languages
Java 89.8%
Kotlin 10.2%