The test doesn't need to mock fragment at all, just need to pass in a fragment without activity. Bug: 314929422 Test: atest Change-Id: I9fb2f38c9c00109dd0d74c8f1e0d405022f634e3
Running Settings Robolectric tests
The full suite
$ croot
$ make RunSettingsRoboTests
Running a single test class
$ croot
$ make RunSettingsRoboTests ROBOTEST_FILTER=<ClassName>
For example:
make RunSettingsRoboTests ROBOTEST_FILTER=CodeInspectionTest
You can also use partial class name in ROBOTEST_FILTER. If the partial class name matches multiple file names, all of them will be executed.