Root Cause: 1. onActivityCreated() has been deprecated 2. mCapabilities will be 0 when updateAlertDialogEnableState(), because onCreateDialog() will get mCapabilities but it will be called after onCreate() and before onCreateView(); onActivityCreated() will set mCapabilities but it will be called after onCreateView() Solution: Move deprecated flow onActivityCreated() into onCreate() to set mCapabilities first Bug: 172171402 Bug: 168567356 Test: atest MagnificationSettingsFragmentTest Change-Id: Id9f861d59fa23f5cb77aac55b87152e921246135
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.